From aefb80524ac814090b305bb508b06426081d7642 Mon Sep 17 00:00:00 2001 From: jlaine Date: Mon, 29 Jun 2009 10:08:09 +0000 Subject: [PATCH] rename modules git-svn-id: https://svn.bolloretelecom.eu/opensource/django-ldapdb/trunk@438 e071eeec-0327-468d-9b6a-08194a12b294 --- ldapdb/models/__init__.py | 1 + ldapdb/models/base.py | 10 +++++----- ldapdb/models/query.py | 5 +++-- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/ldapdb/models/__init__.py b/ldapdb/models/__init__.py index 308fc87..b6b7a19 100644 --- a/ldapdb/models/__init__.py +++ b/ldapdb/models/__init__.py @@ -18,3 +18,4 @@ # along with this program. If not, see . # +from ldapdb.models.base import Model diff --git a/ldapdb/models/base.py b/ldapdb/models/base.py index 11b03d6..c64e59d 100644 --- a/ldapdb/models/base.py +++ b/ldapdb/models/base.py @@ -25,8 +25,8 @@ import logging 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): """ @@ -77,7 +77,7 @@ class Model(django.db.models.base.Model): 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 @@ -93,7 +93,7 @@ class Model(django.db.models.base.Model): 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 @@ -115,7 +115,7 @@ class Model(django.db.models.base.Model): 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) diff --git a/ldapdb/models/query.py b/ldapdb/models/query.py index aa615c2..8890b53 100644 --- a/ldapdb/models/query.py +++ b/ldapdb/models/query.py @@ -27,7 +27,8 @@ from django.db.models.query import QuerySet as BaseQuerySet 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 = "" @@ -51,7 +52,7 @@ class Query(BaseQuery): 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, -- 2.30.2