move transaction disable
[matthijs/upstream/django-ldapdb.git] / ldapdb / backends / ldap / base.py
index 85b857fb8fd4d6d7913ebe2bf9a8577928d122d6..201f287a4c5dff82bc0ef83ce7a8bed1815dd4ca 100644 (file)
 import ldap
 
 from django.db.backends import BaseDatabaseFeatures, BaseDatabaseOperations, BaseDatabaseWrapper
+from django.db.backends.creation import BaseDatabaseCreation
+
+class DatabaseCreation(BaseDatabaseCreation):
+    def create_test_db(self, verbosity=1, autoclobber=False):
+        """
+        Creates a test database, prompting the user for confirmation if the
+        database already exists. Returns the name of the test database created.
+        """
+        pass
+
+    def destroy_test_db(self, old_database_name, verbosity=1):
+        """
+        Destroy a test database, prompting the user for confirmation if the
+        database already exists. Returns the name of the test database created.
+        """
+        pass
 
 class DatabaseCursor(object):
     def __init__(self, ldap_connection):
@@ -55,8 +71,10 @@ class DatabaseWrapper(BaseDatabaseWrapper):
         super(DatabaseWrapper, self).__init__(*args, **kwargs)
 
         self.charset = "utf-8"
+        self.creation = DatabaseCreation(self)
         self.features = DatabaseFeatures(self)
         self.ops = DatabaseOperations()
+        self.settings_dict['SUPPORTS_TRANSACTIONS'] = False
 
     def close(self):
         pass
@@ -91,7 +109,7 @@ class DatabaseWrapper(BaseDatabaseWrapper):
         cursor = self._cursor()
         return cursor.connection.rename_s(dn.encode(self.charset), newrdn.encode(self.charset))
 
-    def search_s(self, base, scope, filterstr, attrlist):
+    def search_s(self, base, scope, filterstr='(objectClass=*)',attrlist=None):
         cursor = self._cursor()
         results = cursor.connection.search_s(base, scope, filterstr.encode(self.charset), attrlist)
         output = []