From: Olivier S. <oli...@gm...> - 2008-04-22 19:26:40
|
Hi all, I've been using python-ldap a lot, thanks for the great work! In my use of python-ldap I've often used a self-developed high level class for ldap-object handling. Adding a new ldap entry for example (ld is a python-ldap object): lo = LdapOO.LdapObject() lo.set_dn_attribs(['cn']) lo.add_attribute_value('cn','test2') lo.set_base_dn('ou=People,o=myorg') lo.add_attribute_value('objectClass','inetOrgPerson') lo.commit_s(ld) or modifying an existing ldap entry: res=ld.search_s('ou=People,o=fakenet',ldap.SCOPE_SUBTREE,'(sn=surname)') lo = LdapOO.LdapObject(res[0][0],res[0][1]) lo.add_attribute_value('sn','surname') if (not lo.has_attribute('street')): lo.add_attribute_value('street','new street') lo.commit_s(ld) since I use this class often, I was wondering if there are more people that like such a high-level API, and perhaps this can be developed further and added to python-ldap ? regards, Olivier Sessink |