class ILDAPEntry(Interface): (source)
Known implementations: ldaptor.entry.BaseLDAPEntry
, ldaptor.protocols.ldap.ldapsyntax.LDAPEntryWithClient
Pythonic API for LDAP object access and modification. >>> o=LDAPEntry(client=ldapclient.LDAPClient(), ... dn='cn=foo,dc=example,dc=com', ... attributes={'anAttribute': ['itsValue', 'secondValue'], ... 'onemore': ['aValue'], ... }) >>> o LDAPEntry(dn='cn=foo,dc=example,dc=com', attributes={'anAttribute': ['itsValue', 'secondValue'], 'onemore': ['aValue']})
Method | __contains__ |
TODO |
Method | __eq__ |
Comparison. Only equality is supported. |
Method | __getitem__ |
Get all values of an attribute. |
Method | __len__ |
TODO |
Method | __ne__ |
Inequality comparison. See L{__eq__}. |
Method | __nonzero__ |
Always return True |
Method | __str__ |
Stringify as LDIF. |
Method | bind |
Try to authenticate with given secret. |
Method | get |
Get all values of an attribute. |
Method | has |
TODO |
Method | items |
TODO |
Method | keys |
TODO |
Comparison. Only equality is supported. >>> client=ldapclient.LDAPClient() >>> a=LDAPEntry(client=client, ... dn='dc=example,dc=com') >>> b=LDAPEntry(client=client, ... dn='dc=example,dc=com') >>> a==b 1 >>> c=LDAPEntry(client=ldapclient.LDAPClient(), ... dn='ou=different,dc=example,dc=com') >>> a==c 0 Comparison does not consider the client of the object. >>> anotherClient=ldapclient.LDAPClient() >>> d=LDAPEntry(client=anotherClient, ... dn='dc=example,dc=com') >>> a==d 1
Get all values of an attribute. >>> o=LDAPEntry(client=ldapclient.LDAPClient(), ... dn='cn=foo,dc=example,dc=com', ... attributes={'anAttribute': ['itsValue']}) >>> o['anAttribute'] ['itsValue']
Stringify as LDIF. >>> o=LDAPEntry(client=ldapclient.LDAPClient(), ... dn='cn=foo,dc=example,dc=com', ... attributes={'anAttribute': ['itsValue', 'secondValue'], ... 'onemore': ['aValue'], ... }) >>> # must use rstrip or doctests won't like it due to the empty line >>> # you can just say "print o" >>> print str(o).rstrip() dn: cn=foo,dc=example,dc=com anAttribute: itsValue anAttribute: secondValue onemore: aValue
Try to authenticate with given secret. @return: Deferred ILDAPEntry (that is, self). @raise ldaperrors.LDAPInvalidCredentials: password was incorrect.