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

Class IEditableLDAPEntry

source code

zope.interface.Interface --+
                           |
                          IEditableLDAPEntry

Interface definition for editable LDAP entries.

Instance Methods [hide private]
 
__setitem__(self, key, value)
Set values of an attribute.
source code
 
__delitem__(self, key)
Delete all values of an attribute.
source code
 
undo(self)
Forget all pending changes.
source code
 
commit(self)
Send all pending changes to the LDAP server.
source code
 
move(self, newDN)
Move the object to a new DN.
source code
 
delete(self)
Delete this object from the LDAP server.
source code
 
setPassword(self, newPasswd)
Set all applicable passwords for this object.
source code
Class Variables [hide private]
  _InterfaceClass__attrs = {'__delitem__': <zope.interface.inter...
  __bases__ = (<InterfaceClass zope.interface.Interface>)
  __identifier__ = 'ldaptor.interfaces.IEditableLDAPEntry'
  __iro__ = (<InterfaceClass ldaptor.interfaces.IEditableLDAPEnt...
  __name__ = 'IEditableLDAPEntry'
  __sro__ = (<InterfaceClass ldaptor.interfaces.IEditableLDAPEnt...
  _implied = {<InterfaceClass ldaptor.interfaces.IEditableLDAPEn...
  dependents = <WeakKeyDictionary at 139824190474144>

Inherited from zope.interface.Interface (private): _Element__tagged_values

Method Details [hide private]

__setitem__(self, key, value)
(Index assignment operator)

source code 

Set values of an attribute. Please use lists. Do not modify the lists in place, that's not supported _yet_.

>>> o=LDAPEntry(client=ldapclient.LDAPClient(),
...     dn='cn=foo,dc=example,dc=com',
...     attributes={'anAttribute': ['itsValue']})
>>> o['anAttribute']=['foo', 'bar']
>>> o['anAttribute']
['bar', 'foo']

__delitem__(self, key)
(Index deletion operator)

source code 

Delete all values of an attribute.

>>> o=LDAPEntry(client=ldapclient.LDAPClient(),
...     dn='cn=foo,dc=example,dc=com',
...     attributes={
...     'anAttribute': ['itsValue', 'secondValue'],
...     'another': ['moreValues'],
...     })
>>> del o['anAttribute']
>>> o
LDAPEntry(dn='cn=foo,dc=example,dc=com', attributes={'another': ['moreValues']})

commit(self)

source code 

Send all pending changes to the LDAP server.

Returns:
a Deferred that tells you whether the operation succeeded or not. (TODO specify how)

move(self, newDN)

source code 

Move the object to a new DN.

Parameters:
  • newDN - the new DistinguishedName
Returns:
A Deferred that will complete when the move is done.

delete(self)

source code 

Delete this object from the LDAP server.

Returns:
A Deferred that will complete when the delete is done.

setPassword(self, newPasswd)

source code 

Set all applicable passwords for this object.

Parameters:
  • newPasswd - A string containing the new password.
Returns:
A Deferred that will complete when the operation is done.

Class Variable Details [hide private]

_InterfaceClass__attrs

Value:
{'__delitem__': <zope.interface.interface.Method object at 0x7f2b5b337\
f90>,
 '__setitem__': <zope.interface.interface.Method object at 0x7f2b5b34b\
090>,
 'commit': <zope.interface.interface.Method object at 0x7f2b5b34b110>,
 'delete': <zope.interface.interface.Method object at 0x7f2b5b34b150>,
 'move': <zope.interface.interface.Method object at 0x7f2b5b337fd0>,
 'setPassword': <zope.interface.interface.Method object at 0x7f2b5b34b\
...

__iro__

Value:
(<InterfaceClass ldaptor.interfaces.IEditableLDAPEntry>,
 <InterfaceClass zope.interface.Interface>)

__sro__

Value:
(<InterfaceClass ldaptor.interfaces.IEditableLDAPEntry>,
 <InterfaceClass zope.interface.Interface>)

_implied

Value:
{<InterfaceClass ldaptor.interfaces.IEditableLDAPEntry>: (),
 <InterfaceClass zope.interface.Interface>: ()}