tldap.base

Contains base class used for tldap objects.

class tldap.base.LDAPmeta[source]

The meta class used for tldap objects.

class tldap.base.LDAPobject(using=None, settings=None, **kwargs)[source]

The base class used for tldap objects.

delete()[source]

Delete this object from the LDAP server.

Parameters:self – object to delete.
dn[source]

Get the current dn.

classmethod get_default_base_dn(using, settings)[source]

Get the default base_dn for this class.

Parameters:
  • cls – This class.
  • using – The LDAP database alias.
  • settings – A set of parameters that may be useful in derived classes.
Returns:

Fully qualified base dn. May be None if unsuccessful.

rename(new_base_dn=None, **kwargs)[source]

Rename this entry. Use like object.rename(uid=”new”) or object.rename(cn=”new”). Can pass a list in using, as all connections must be renamed at once.

Parameters:
  • self – object to rename.
  • new_base_dn – move entry to this parent.
  • kwargs – Contains new rdn of object.
save(force_add=False, force_modify=False)[source]

Saves the current instance. Override this in a subclass if you want to control the saving process.

Parameters:
  • self – object to save.
  • force_add – Assume object doesn’t already exist and must be created.
  • force_modify – Assume oobject already exists and must be updated.
schema_list = []

Class variable to be overriden for class that provides a list of schemas to be used.

unparse(ldif_writer, new_dn=None, extra_fields={})[source]

Translate object into ldif.

Parameters:
  • self – object to translate.
  • ldif_writer – ldif_writer to write translation to.
  • extra_fields – extra fields to display

Previous topic

tldap

Next topic

tldap.exceptions

This Page