cri_models.ldap.models module

class cri_models.ldap.models.DN(ldap_model, *args, **kwargs)[source]

Bases: str

property obj
class cri_models.ldap.models.LDAPDNField(ldap_model, *args, **kwargs)[source]

Bases: django.db.models.fields.CharField

deconstruct()[source]

Return enough information to recreate the field as a 4-tuple:

  • The name of the field on the model, if contribute_to_class() has been run.

  • The import path of the field, including the class:e.g. django.db.models.IntegerField This should be the most portable version, so less specific may be better.

  • A list of positional arguments.

  • A dict of keyword arguments.

Note that the positional or keyword arguments must contain values of the following types (including inner values of collection types):

  • None, bool, str, int, float, complex, set, frozenset, list, tuple, dict

  • UUID

  • datetime.datetime (naive), datetime.date

  • top-level classes, top-level functions - will be referenced by their full import path

  • Storage instances - these have their own deconstruct() method

This is because the values here must be serialized into a text format (possibly new Python code, possibly JSON) and these are the only types with encoding handlers defined.

There’s no need to return the exact way the field was instantiated this time, just ensure that the resulting field is the same - prefer keyword arguments over positional ones, and omit parameters with their default values.

from_db_value(value, _expression, _connection)[source]
get_prep_value(value)[source]

Perform preliminary non-db specific value checks and conversions.

to_python(value)[source]

Convert the input value into the expected Python data type, raising django.core.exceptions.ValidationError if the data can’t be converted. Return the converted value. Subclasses should override this.

class cri_models.ldap.models.LDAPEntry(classes, dn, created_at, created_by, updated_at, updated_by)[source]

Bases: cri_models.ldap.models.LDAPModel

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

get_next_by_created_at(*, field=<ldapdb.models.fields.DateTimeField: created_at>, is_next=True, **kwargs)
get_next_by_updated_at(*, field=<ldapdb.models.fields.DateTimeField: updated_at>, is_next=True, **kwargs)
get_previous_by_created_at(*, field=<ldapdb.models.fields.DateTimeField: created_at>, is_next=False, **kwargs)
get_previous_by_updated_at(*, field=<ldapdb.models.fields.DateTimeField: updated_at>, is_next=False, **kwargs)
objects = <django.db.models.manager.Manager object>
class cri_models.ldap.models.LDAPModel(*args, **kwargs)[source]

Bases: ldapdb.models.base.Model

DB_RO_FIELDS = ('created_at', 'created_by', 'updated_at', 'updated_by')
class LDAPMeta[source]

Bases: object

class Meta[source]

Bases: object

abstract = False
RO_FIELDS = ('dn', 'classes', 'created_at', 'created_by', 'updated_at', 'updated_by')
base_dn = 'dummy'
classes

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

created_at

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

created_by

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

delete_subtree()[source]
classmethod get_base_dn()[source]
get_next_by_created_at(*, field=<ldapdb.models.fields.DateTimeField: created_at>, is_next=True, **kwargs)
get_next_by_updated_at(*, field=<ldapdb.models.fields.DateTimeField: updated_at>, is_next=True, **kwargs)
get_object_classes_map()[source]
get_previous_by_created_at(*, field=<ldapdb.models.fields.DateTimeField: created_at>, is_next=False, **kwargs)
get_previous_by_updated_at(*, field=<ldapdb.models.fields.DateTimeField: updated_at>, is_next=False, **kwargs)
object_classes = ['top']
relative_base_dn = None
updated_at

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

updated_by

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.