本文整理汇总了Python中django.db.backends.BaseDatabaseWrapper类的典型用法代码示例。如果您正苦于以下问题:Python BaseDatabaseWrapper类的具体用法?Python BaseDatabaseWrapper怎么用?Python BaseDatabaseWrapper使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了BaseDatabaseWrapper类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: close
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)
示例2: _rollback
def _rollback(self):
try:
BaseDatabaseWrapper._rollback(self)
except Database.NotSupportedError:
pass
except NotSupportedError:
pass
示例3: close
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: __init__
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)
示例5: make_debug_cursor
def make_debug_cursor(self, cursor):
return BaseDatabaseWrapper.make_debug_cursor(self, MysqlDebugWrapper(cursor))