Loading django/contrib/gis/db/backends/mysql/base.py +2 −4 Original line number Diff line number Diff line Loading @@ -20,13 +20,11 @@ class DatabaseFeatures(BaseSpatialFeatures, MySQLDatabaseFeatures): class DatabaseWrapper(MySQLDatabaseWrapper): SchemaEditorClass = MySQLGISSchemaEditor def __init__(self, *args, **kwargs): super(DatabaseWrapper, self).__init__(*args, **kwargs) self.features = DatabaseFeatures(self) self.creation = MySQLCreation(self) self.ops = MySQLOperations(self) self.introspection = MySQLIntrospection(self) def schema_editor(self, *args, **kwargs): "Returns a new instance of this backend's SchemaEditor" return MySQLGISSchemaEditor(self, *args, **kwargs) django/contrib/gis/db/backends/oracle/base.py +2 −3 Original line number Diff line number Diff line Loading @@ -15,12 +15,11 @@ class DatabaseFeatures(BaseSpatialFeatures, OracleDatabaseFeatures): class DatabaseWrapper(OracleDatabaseWrapper): SchemaEditorClass = OracleGISSchemaEditor def __init__(self, *args, **kwargs): super(DatabaseWrapper, self).__init__(*args, **kwargs) self.features = DatabaseFeatures(self) self.ops = OracleOperations(self) self.creation = OracleCreation(self) self.introspection = OracleIntrospection(self) def schema_editor(self, *args, **kwargs): return OracleGISSchemaEditor(self, *args, **kwargs) django/contrib/gis/db/backends/postgis/base.py +2 −4 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ class DatabaseFeatures(BaseSpatialFeatures, Psycopg2DatabaseFeatures): class DatabaseWrapper(Psycopg2DatabaseWrapper): SchemaEditorClass = PostGISSchemaEditor def __init__(self, *args, **kwargs): super(DatabaseWrapper, self).__init__(*args, **kwargs) if kwargs.get('alias', '') != NO_DB_ALIAS: Loading @@ -23,7 +25,3 @@ class DatabaseWrapper(Psycopg2DatabaseWrapper): self.creation = PostGISCreation(self) self.ops = PostGISOperations(self) self.introspection = PostGISIntrospection(self) def schema_editor(self, *args, **kwargs): "Returns a new instance of this backend's SchemaEditor" return PostGISSchemaEditor(self, *args, **kwargs) django/contrib/gis/db/backends/spatialite/base.py +2 −4 Original line number Diff line number Diff line Loading @@ -22,6 +22,8 @@ class DatabaseFeatures(BaseSpatialFeatures, SQLiteDatabaseFeatures): class DatabaseWrapper(SQLiteDatabaseWrapper): SchemaEditorClass = SpatialiteSchemaEditor def __init__(self, *args, **kwargs): # Before we get too far, make sure pysqlite 2.5+ is installed. if Database.version_info < (2, 5, 0): Loading @@ -47,10 +49,6 @@ class DatabaseWrapper(SQLiteDatabaseWrapper): self.creation = SpatiaLiteCreation(self) self.introspection = SpatiaLiteIntrospection(self) def schema_editor(self, *args, **kwargs): "Returns a new instance of this backend's SchemaEditor" return SpatialiteSchemaEditor(self, *args, **kwargs) def get_new_connection(self, conn_params): conn = super(DatabaseWrapper, self).get_new_connection(conn_params) # Enabling extension loading on the SQLite connection. Loading django/db/backends/__init__.py +8 −2 Original line number Diff line number Diff line Loading @@ -37,6 +37,7 @@ class BaseDatabaseWrapper(object): """ ops = None vendor = 'unknown' SchemaEditorClass = None queries_limit = 9000 Loading Loading @@ -479,8 +480,13 @@ class BaseDatabaseWrapper(object): ) def schema_editor(self, *args, **kwargs): "Returns a new instance of this backend's SchemaEditor" raise NotImplementedError('subclasses of BaseDatabaseWrapper may require a schema_editor() method') """ Returns a new instance of this backend's SchemaEditor. """ if self.SchemaEditorClass is None: raise NotImplementedError( 'The SchemaEditorClass attribute of this database wrapper is still None') return self.SchemaEditorClass(self, *args, **kwargs) class BaseDatabaseFeatures(object): Loading Loading
django/contrib/gis/db/backends/mysql/base.py +2 −4 Original line number Diff line number Diff line Loading @@ -20,13 +20,11 @@ class DatabaseFeatures(BaseSpatialFeatures, MySQLDatabaseFeatures): class DatabaseWrapper(MySQLDatabaseWrapper): SchemaEditorClass = MySQLGISSchemaEditor def __init__(self, *args, **kwargs): super(DatabaseWrapper, self).__init__(*args, **kwargs) self.features = DatabaseFeatures(self) self.creation = MySQLCreation(self) self.ops = MySQLOperations(self) self.introspection = MySQLIntrospection(self) def schema_editor(self, *args, **kwargs): "Returns a new instance of this backend's SchemaEditor" return MySQLGISSchemaEditor(self, *args, **kwargs)
django/contrib/gis/db/backends/oracle/base.py +2 −3 Original line number Diff line number Diff line Loading @@ -15,12 +15,11 @@ class DatabaseFeatures(BaseSpatialFeatures, OracleDatabaseFeatures): class DatabaseWrapper(OracleDatabaseWrapper): SchemaEditorClass = OracleGISSchemaEditor def __init__(self, *args, **kwargs): super(DatabaseWrapper, self).__init__(*args, **kwargs) self.features = DatabaseFeatures(self) self.ops = OracleOperations(self) self.creation = OracleCreation(self) self.introspection = OracleIntrospection(self) def schema_editor(self, *args, **kwargs): return OracleGISSchemaEditor(self, *args, **kwargs)
django/contrib/gis/db/backends/postgis/base.py +2 −4 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ class DatabaseFeatures(BaseSpatialFeatures, Psycopg2DatabaseFeatures): class DatabaseWrapper(Psycopg2DatabaseWrapper): SchemaEditorClass = PostGISSchemaEditor def __init__(self, *args, **kwargs): super(DatabaseWrapper, self).__init__(*args, **kwargs) if kwargs.get('alias', '') != NO_DB_ALIAS: Loading @@ -23,7 +25,3 @@ class DatabaseWrapper(Psycopg2DatabaseWrapper): self.creation = PostGISCreation(self) self.ops = PostGISOperations(self) self.introspection = PostGISIntrospection(self) def schema_editor(self, *args, **kwargs): "Returns a new instance of this backend's SchemaEditor" return PostGISSchemaEditor(self, *args, **kwargs)
django/contrib/gis/db/backends/spatialite/base.py +2 −4 Original line number Diff line number Diff line Loading @@ -22,6 +22,8 @@ class DatabaseFeatures(BaseSpatialFeatures, SQLiteDatabaseFeatures): class DatabaseWrapper(SQLiteDatabaseWrapper): SchemaEditorClass = SpatialiteSchemaEditor def __init__(self, *args, **kwargs): # Before we get too far, make sure pysqlite 2.5+ is installed. if Database.version_info < (2, 5, 0): Loading @@ -47,10 +49,6 @@ class DatabaseWrapper(SQLiteDatabaseWrapper): self.creation = SpatiaLiteCreation(self) self.introspection = SpatiaLiteIntrospection(self) def schema_editor(self, *args, **kwargs): "Returns a new instance of this backend's SchemaEditor" return SpatialiteSchemaEditor(self, *args, **kwargs) def get_new_connection(self, conn_params): conn = super(DatabaseWrapper, self).get_new_connection(conn_params) # Enabling extension loading on the SQLite connection. Loading
django/db/backends/__init__.py +8 −2 Original line number Diff line number Diff line Loading @@ -37,6 +37,7 @@ class BaseDatabaseWrapper(object): """ ops = None vendor = 'unknown' SchemaEditorClass = None queries_limit = 9000 Loading Loading @@ -479,8 +480,13 @@ class BaseDatabaseWrapper(object): ) def schema_editor(self, *args, **kwargs): "Returns a new instance of this backend's SchemaEditor" raise NotImplementedError('subclasses of BaseDatabaseWrapper may require a schema_editor() method') """ Returns a new instance of this backend's SchemaEditor. """ if self.SchemaEditorClass is None: raise NotImplementedError( 'The SchemaEditorClass attribute of this database wrapper is still None') return self.SchemaEditorClass(self, *args, **kwargs) class BaseDatabaseFeatures(object): Loading