コード例 #1
0
ファイル: base.py プロジェクト: fizista/django-cassandra
 def _rollback(self):
     try:
         BaseDatabaseWrapper._rollback(self)
     except Database.NotSupportedError:
         pass
     except NotSupportedError:
         pass
コード例 #2
0
ファイル: base.py プロジェクト: 5977862/django
 def close(self):
     self.validate_thread_sharing()
     # If database is in memory, closing the connection destroys the
     # database. To prevent accidental data loss, ignore close requests on
     # an in-memory db.
     if self.settings_dict['NAME'] != ":memory:":
         BaseDatabaseWrapper.close(self)
コード例 #3
0
ファイル: base.py プロジェクト: hfeeki/geodjango
 def close(self):
     from django.conf import settings
     # If database is in memory, closing the connection destroys the
     # database. To prevent accidental data loss, ignore close requests on
     # an in-memory db.
     if settings.DATABASE_NAME != ":memory:":
         BaseDatabaseWrapper.close(self)
コード例 #4
0
ファイル: base.py プロジェクト: IRI-Research/django
 def close(self):
     self.validate_thread_sharing()
     # If database is in memory, closing the connection destroys the
     # database. To prevent accidental data loss, ignore close requests on
     # an in-memory db.
     if self.settings_dict['NAME'] != ":memory:":
         BaseDatabaseWrapper.close(self)
コード例 #5
0
 def close(self):
     from django.conf import settings
     # If database is in memory, closing the connection destroys the
     # database. To prevent accidental data loss, ignore close requests on
     # an in-memory db.
     if settings.DATABASE_NAME != ":memory:":
         BaseDatabaseWrapper.close(self)
コード例 #6
0
    def __init__(self, *args, **kwargs):
        BaseDatabaseWrapper.__init__(self, *args, **kwargs)

        self.server_version = None
        self.features = DatabaseFeatures(self)
        self.ops = DatabaseOperations(self)
        self.client = DatabaseClient(self)
        self.creation = DatabaseCreation(self)
        self.introspection = DatabaseIntrospection(self)
        self.validation = DatabaseValidation(self)
コード例 #7
0
    def test_compare_db_wrappers(self):
        wrapper1 = DummyDatabaseWrapper({})
        wrapper2 = BaseDatabaseWrapper({})

        wrapper1.alias = wrapper2.alias = 'foo'
        self.assertTrue(wrapper1 == wrapper2)

        wrapper1.alias = 'bar'
        self.assertFalse(wrapper1 == wrapper2)
コード例 #8
0
 def test_negate_compare_db_wrapper_with_another_object(self):
     wrapper = BaseDatabaseWrapper({})
     self.assertTrue(wrapper != 'not-a-db-wrapper')
コード例 #9
0
 def test_compare_db_wrapper_with_another_object_with_alias(self):
     wrapper = BaseDatabaseWrapper({})
     obj = DummyObject()
     obj.alias = wrapper.alias = 'foobar'
     self.assertFalse(wrapper == obj)
コード例 #10
0
 def test_compare_db_wrapper_with_another_object(self):
     wrapper = BaseDatabaseWrapper({})
     self.assertFalse(wrapper == 'not-a-db-wrapper')
コード例 #11
0
ファイル: base.py プロジェクト: trudger/django
 def _rollback(self):
     try:
         BaseDatabaseWrapper._rollback(self)
     except Database.NotSupportedError:
         pass
コード例 #12
0
ファイル: base.py プロジェクト: hfeeki/geodjango
 def make_debug_cursor(self, cursor):
     return BaseDatabaseWrapper.make_debug_cursor(self, MysqlDebugWrapper(cursor))
コード例 #13
0
 def make_debug_cursor(self, cursor):
     return BaseDatabaseWrapper.make_debug_cursor(self,
                                                  MysqlDebugWrapper(cursor))