1
0
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:
Adrian Holovaty
2007-08-19 22:29:57 +00:00
parent 7c41b19c8a
commit 38b5d7f23d
10 changed files with 85 additions and 47 deletions

View File

@@ -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