#22790 closed Bug (fixed)
spatialite/Oracle GIS app_label deprecation warnings
Reported by: | Tim Graham | Owned by: | Aymeric Augustin |
---|---|---|---|
Component: | GIS | Version: | 1.7-beta-2 |
Severity: | Release blocker | Keywords: | app-loading |
Cc: | Aymeric Augustin | Triage Stage: | Accepted |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
/home/tim/code/django/django/contrib/gis/db/backends/spatialite/models.py:10: RemovedInDjango19Warning: Model class django.contrib.gis.db.backends.spatialite.models.GeometryColumns doesn't declare an explicit app_label and either isn't in an application in INSTALLED_APPS or else was imported before its application was loaded. This will no longer be supported in Django 1.9. class GeometryColumns(models.Model): /home/tim/code/django/django/contrib/gis/db/backends/spatialite/models.py:47: RemovedInDjango19Warning: Model class django.contrib.gis.db.backends.spatialite.models.SpatialRefSys doesn't declare an explicit app_label and either isn't in an application in INSTALLED_APPS or else was imported before its application was loaded. This will no longer be supported in Django 1.9.
Tried adding app_label = 'gis'
to the models, but ran into another problem:
====================================================================== ERROR: django.contrib.gis.tests.tests (unittest.loader.ModuleImportFailure) ---------------------------------------------------------------------- ImportError: Failed to import test module: django.contrib.gis.tests.tests Traceback (most recent call last): File "/usr/lib/python2.7/unittest/loader.py", line 252, in _find_tests module = self._get_module_from_name(name) File "/usr/lib/python2.7/unittest/loader.py", line 230, in _get_module_from_name __import__(name) File "/home/tim/code/django/django/contrib/gis/tests/tests.py", line 9, in <module> from django.contrib.gis.db.backends.postgis.operations import PostGISOperations File "/home/tim/code/django/django/contrib/gis/db/backends/postgis/operations.py", line 16, in <module> from .models import GeometryColumns, SpatialRefSys File "/home/tim/code/django/django/contrib/gis/db/backends/postgis/models.py", line 10, in <module> class GeometryColumns(models.Model): File "/home/tim/code/django/django/db/models/base.py", line 287, in __new__ new_class._meta.apps.register_model(new_class._meta.app_label, new_class) File "/home/tim/code/django/django/apps/registry.py", line 201, in register_model (model_name, app_label, app_models[model_name], model)) RuntimeError: Conflicting 'geometrycolumns' models in application 'gis': <class 'django.contrib.gis.db.backends.spatialite.models.GeometryColumns'> and <class 'django.contrib.gis.db.backends.postgis.models.GeometryColumns'>.
Change History (8)
comment:1 by , 10 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:4 by , 10 years ago
Severity: | Normal → Release blocker |
---|
Unfortunately I lack the ability to test this on Spatialite and Oracle GIS.
comment:5 by , 10 years ago
Tested successfully on Spatialite, but one of the models is missing the app_label
. Seems one is missing too in Oracle models, but I cannot test Oracle.
comment:6 by , 10 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Note:
See TracTickets
for help on using tickets.
I'm afraid there's no other solution than renaming the backend-specific SpatialSysRef models.
Otherwise you couldn't use Postgis and Spatialite in the same projet.