import django.db.models
-from granadilla.db import connection as ldap_connection
-from granadilla.db.query import QuerySet
+import ldapdb
+from ldapdb.models.query import QuerySet
class ModelBase(django.db.models.base.ModelBase):
"""
Delete this entry.
"""
logging.debug("Deleting LDAP entry %s" % self.dn)
- ldap_connection.delete_s(self.dn)
+ ldapdb.connection.delete_s(self.dn)
def save(self):
# create a new entry
entry.append((field.db_column, value))
logging.debug("Creating new LDAP entry %s" % new_dn)
- ldap_connection.add_s(new_dn, entry)
+ ldapdb.connection.add_s(new_dn, entry)
# update object
self.dn = new_dn
if len(modlist):
logging.debug("Modifying existing LDAP entry %s" % self.dn)
- ldap_connection.modify_s(self.dn, modlist)
+ ldapdb.connection.modify_s(self.dn, modlist)
else:
logging.debug("No changes to be saved to LDAP entry %s" % self.dn)
from django.db.models.query_utils import Q
from django.db.models.sql import BaseQuery
from django.db.models.sql.where import WhereNode
-from granadilla.db import connection as ldap_connection
+
+import ldapdb
def compile(q):
filterstr = ""
attrlist = [ x.db_column for x in self.model._meta.local_fields if x.db_column ]
try:
- vals = ldap_connection.search_s(
+ vals = ldapdb.connection.search_s(
self.model._meta.dn,
ldap.SCOPE_SUBTREE,
filterstr=filterstr,