Ticket #9405: django-db-operations.diff
File django-db-operations.diff, 5.2 KB (added by , 16 years ago) |
---|
-
db/backends/dummy/base.py
45 45 super(DatabaseWrapper, self).__init__(*args, **kwargs) 46 46 47 47 self.features = BaseDatabaseFeatures() 48 self.ops = DatabaseOperations( )48 self.ops = DatabaseOperations(self) 49 49 self.client = DatabaseClient() 50 50 self.creation = BaseDatabaseCreation(self) 51 51 self.introspection = DatabaseIntrospection(self) -
db/backends/mysql/base.py
223 223 self.server_version = None 224 224 225 225 self.features = DatabaseFeatures() 226 self.ops = DatabaseOperations( )226 self.ops = DatabaseOperations(self) 227 227 self.client = DatabaseClient() 228 228 self.creation = DatabaseCreation(self) 229 229 self.introspection = DatabaseIntrospection(self) -
db/backends/oracle/base.py
137 137 def regex_lookup(self, lookup_type): 138 138 # If regex_lookup is called before it's been initialized, then create 139 139 # a cursor to initialize it and recur. 140 from django.db import connection 141 connection.cursor() 140 self.connection.cursor() 142 141 return connection.ops.regex_lookup(lookup_type) 143 142 144 143 def sql_flush(self, style, tables, sequences): … … 231 230 super(DatabaseWrapper, self).__init__(*args, **kwargs) 232 231 233 232 self.features = DatabaseFeatures() 234 self.ops = DatabaseOperations( )233 self.ops = DatabaseOperations(self) 235 234 self.client = DatabaseClient() 236 235 self.creation = DatabaseCreation(self) 237 236 self.introspection = DatabaseIntrospection(self) -
db/backends/postgresql/base.py
89 89 super(DatabaseWrapper, self).__init__(*args, **kwargs) 90 90 91 91 self.features = DatabaseFeatures() 92 self.ops = DatabaseOperations( )92 self.ops = DatabaseOperations(self) 93 93 self.client = DatabaseClient() 94 94 self.creation = DatabaseCreation(self) 95 95 self.introspection = DatabaseIntrospection(self) -
db/backends/postgresql/operations.py
8 8 # used by both the 'postgresql' and 'postgresql_psycopg2' backends. 9 9 10 10 class DatabaseOperations(BaseDatabaseOperations): 11 def __init__(self ):11 def __init__(self, *args): 12 12 self._postgres_version = None 13 return super(DatabaseOperations, self).__init__(*args) 13 14 14 15 def _get_postgres_version(self): 15 16 if self._postgres_version is None: 16 from django.db import connection 17 cursor = connection.cursor() 17 cursor = self.connection.cursor() 18 18 cursor.execute("SELECT version()") 19 19 version_string = cursor.fetchone()[0] 20 20 m = server_version_re.match(version_string) -
db/backends/postgresql_psycopg2/base.py
59 59 super(DatabaseWrapper, self).__init__(*args, **kwargs) 60 60 61 61 self.features = DatabaseFeatures() 62 self.ops = DatabaseOperations( )62 self.ops = DatabaseOperations(self) 63 63 self.client = DatabaseClient() 64 64 self.creation = DatabaseCreation(self) 65 65 self.introspection = DatabaseIntrospection(self) -
db/backends/sqlite3/base.py
126 126 super(DatabaseWrapper, self).__init__(*args, **kwargs) 127 127 128 128 self.features = DatabaseFeatures() 129 self.ops = DatabaseOperations( )129 self.ops = DatabaseOperations(self) 130 130 self.client = DatabaseClient() 131 131 self.creation = DatabaseCreation(self) 132 132 self.introspection = DatabaseIntrospection(self) -
db/backends/__init__.py
81 81 a backend performs ordering or calculates the ID of a recently-inserted 82 82 row. 83 83 """ 84 def __init__(self, connection): 85 self.connection = connection 86 84 87 def autoinc_sql(self, table, column): 85 88 """ 86 89 Returns any SQL needed to support auto-incrementing primary keys, or