ldap3.abstract.attrDef module

class ldap3.abstract.attrDef.AttrDef(name, key=None, validate=None, pre_query=None, post_query=None, default=NotImplemented, dereference_dn=None, description=None, mandatory=False, single_value=None)

Bases: object

Hold the definition of an attribute

Parameters:
  • name (string) – the real attribute name
  • key (string) – the friendly name to use in queries and when accessing the attribute, default to the real attribute name
  • validate (callable) – called to check if the value in the query is valid, the callable is called with the value parameter
  • pre_query (callable) – called to transform values returned by search
  • post_query (callable) – called to transform values returned by search
  • default (string, integer) – value returned when the attribute is absent (defaults to NotImplemented to allow use of None as default)
  • dereference_dn (ObjectDef) – reference to an ObjectDef instance. When the attribute value contains a dn it will be searched and substituted in the entry
  • description (string) – custom attribute description
  • mandatory (boolean) – specify if attribute is defined as mandatory in LDAP schema