Package ldaptor :: Module interfaces :: Class ILDAPEntry
[show private | hide private]
[frames | no frames]

Type ILDAPEntry

object --+    
         |    
 Interface --+
             |
            ILDAPEntry


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 Summary
  __contains__(self, key)
TODO
  __eq__(self, other)
Comparison.
  __getitem__(self, key)
Get all values of an attribute.
  __len__(self)
TODO
  __ne__(self, other)
Inequality comparison.
  __nonzero__(self)
Always return True
  __str__(self)
Stringify as LDIF.
  get(self, key, default)
Get all values of an attribute.
  has_key(self, key)
TODO
  items(self)
TODO
  keys(self)
TODO
    Inherited from Interface
  adaptWith(self, using, to, registry)
(Class method)
    Inherited from object
  __init__(...)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
  __delattr__(...)
x.__delattr__('name') <==> del x.name
  __getattribute__(...)
x.__getattribute__('name') <==> x.name
  __hash__(x)
x.__hash__() <==> hash(x)
  __new__(T, S, ...)
T.__new__(S, ...) -> a new object with type S, a subtype of T
  __reduce__(...)
helper for pickle
  __reduce_ex__(...)
helper for pickle
  __repr__(x)
x.__repr__() <==> repr(x)
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value

Instance Method Details

__contains__(self, key)
(In operator)

TODO

__eq__(self, other)
(Equality operator)

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

__getitem__(self, key)
(Indexing operator)

Get all values of an attribute.
>>> o=LDAPEntry(client=ldapclient.LDAPClient(),
...     dn='cn=foo,dc=example,dc=com',
...     attributes={'anAttribute': ['itsValue']})
>>> o['anAttribute']
['itsValue']

__len__(self)
(Length operator)

TODO

__ne__(self, other)

Inequality comparison. See __eq__.

__nonzero__(self)
(Boolean test operator)

Always return True

__str__(self)
(Informal representation operator)

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
Overrides:
__builtin__.object.__str__

get(self, key, default=None)

Get all values of an attribute.
>>> o=LDAPEntry(client=ldapclient.LDAPClient(),
...     dn='cn=foo,dc=example,dc=com',
...     attributes={'anAttribute': ['itsValue']})
>>> o.get('anAttribute')
['itsValue']

>>> o.get('foo')
>>> o.get('foo', [])
[]

has_key(self, key)

TODO

items(self)

TODO

keys(self)

TODO

Generated by Epydoc 2.1 on Tue Aug 17 17:08:20 2004 http://epydoc.sf.net