mirror of
https://github.com/django/django.git
synced 2025-10-29 16:46:11 +00:00
Began implementing BaseDatabaseOperations class for every database backend. This class will be used to hold the database-specific methods that currently live at the module level in each backend. Only autoinc_sql() has been implemented so far.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5950 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -5,7 +5,7 @@ Requires psycopg 1: http://initd.org/projects/psycopg1
|
||||
"""
|
||||
|
||||
from django.utils.encoding import smart_str, smart_unicode
|
||||
from django.db.backends import BaseDatabaseWrapper, util
|
||||
from django.db.backends import BaseDatabaseWrapper, BaseDatabaseOperations, util
|
||||
try:
|
||||
import psycopg as Database
|
||||
except ImportError, e:
|
||||
@@ -57,7 +57,12 @@ class UnicodeCursorWrapper(object):
|
||||
|
||||
postgres_version = None
|
||||
|
||||
class DatabaseOperations(BaseDatabaseOperations):
|
||||
pass
|
||||
|
||||
class DatabaseWrapper(BaseDatabaseWrapper):
|
||||
ops = DatabaseOperations()
|
||||
|
||||
def _cursor(self, settings):
|
||||
set_tz = False
|
||||
if self.connection is None:
|
||||
@@ -157,9 +162,6 @@ def get_max_name_length():
|
||||
def get_start_transaction_sql():
|
||||
return "BEGIN;"
|
||||
|
||||
def get_autoinc_sql(table):
|
||||
return None
|
||||
|
||||
def get_sql_flush(style, tables, sequences):
|
||||
"""Return a list of SQL statements required to remove all data from
|
||||
all tables in the database (without actually removing the tables
|
||||
|
||||
Reference in New Issue
Block a user