rename modules
authorjlaine <jlaine@e071eeec-0327-468d-9b6a-08194a12b294>
Mon, 29 Jun 2009 10:08:09 +0000 (10:08 +0000)
committerjlaine <jlaine@e071eeec-0327-468d-9b6a-08194a12b294>
Mon, 29 Jun 2009 10:08:09 +0000 (10:08 +0000)
git-svn-id: https://svn.bolloretelecom.eu/opensource/django-ldapdb/trunk@438 e071eeec-0327-468d-9b6a-08194a12b294

ldapdb/models/__init__.py
ldapdb/models/base.py
ldapdb/models/query.py

index 308fc87dbe20e2bef09c8ed7275c22511d4f4afc..b6b7a1917b6caaf5bac98327d9ec1c67a229f356 100644 (file)
@@ -18,3 +18,4 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 
+from ldapdb.models.base import Model
index 11b03d66710bfa62f2ae67cbd0c8ae81b43637b5..c64e59d9d2fbc52ae766b6ea2ed9651f0cd06f3e 100644 (file)
@@ -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)
 
index aa615c2e077f1b373912c6597dd6c5f14e75dc54..8890b53a4c0ec2dc67d441f192453e70606a0a4d 100644 (file)
@@ -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,