[Django] #27217: GeoDjango issues on Django 1.11.dev version

11 views
Skip to first unread message

Django

unread,
Sep 13, 2016, 9:44:28 AM9/13/16
to django-...@googlegroups.com
#27217: GeoDjango issues on Django 1.11.dev version
---------------------------------+--------------------
Reporter: MVSatish | Owner: nobody
Type: Bug | Status: new
Component: GIS | Version: master
Severity: Release blocker | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
---------------------------------+--------------------
Am Using postgis as a backend and makemigrations threw back the error:


{{{
Traceback (most recent call last):
File "manage.py", line 22, in <module>
execute_from_command_line(sys.argv)
File "/home/satish/work/django/django/core/management/__init__.py", line
366, in execute_from_command_line
utility.execute()
File "/home/satish/work/django/django/core/management/__init__.py", line
358, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/satish/work/django/django/core/management/base.py", line
294, in run_from_argv
self.execute(*args, **cmd_options)
File "/home/satish/work/django/django/core/management/base.py", line
345, in execute
output = self.handle(*args, **options)
File
"/home/satish/work/django/django/core/management/commands/makemigrations.py",
line 173, in handle
migration_name=self.migration_name,
File "/home/satish/work/django/django/db/migrations/autodetector.py",
line 47, in changes
changes = self._detect_changes(convert_apps, graph)
File "/home/satish/work/django/django/db/migrations/autodetector.py",
line 198, in _detect_changes
self._optimize_migrations()
File "/home/satish/work/django/django/db/migrations/autodetector.py",
line 362, in _optimize_migrations
migration.operations =
MigrationOptimizer().optimize(migration.operations, app_label=app_label)
File "/home/satish/work/django/django/db/migrations/optimizer.py", line
38, in optimize
result = self.optimize_inner(operations, app_label)
File "/home/satish/work/django/django/db/migrations/optimizer.py", line
53, in optimize_inner
result = operation.reduce(other, in_between, app_label)
File
"/home/satish/work/django/django/db/migrations/operations/models.py", line
213, in reduce
return super(CreateModel, self).reduce(operation, in_between,
app_label=app_label)
File
"/home/satish/work/django/django/db/migrations/operations/models.py", line
39, in reduce
not operation.references_model(self.name, app_label)
File
"/home/satish/work/django/django/db/migrations/operations/models.py", line
119, in references_model
model_app_label, model_name = self.model_to_key(model)
File
"/home/satish/work/django/django/db/migrations/operations/models.py", line
133, in model_to_key
return model._meta.app_label, model._meta.object_name
AttributeError: type object 'SpatialRefSysMixin' has no attribute '_meta'

}}}

Is GeoDjango ready for 1.11 dev version yet?

--
Ticket URL: <https://code.djangoproject.com/ticket/27217>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Sep 13, 2016, 10:02:14 AM9/13/16
to django-...@googlegroups.com
#27217: GeoDjango issues on Django 1.11.dev version
---------------------------------+--------------------------------------

Reporter: MVSatish | Owner: nobody
Type: Bug | Status: new
Component: GIS | Version: master
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
---------------------------------+--------------------------------------
Changes (by MVSatish):

* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0


Old description:

New description:

}}}

Is GeoDjango not ready for 1.11 dev version yet?

--

--
Ticket URL: <https://code.djangoproject.com/ticket/27217#comment:1>

Django

unread,
Sep 13, 2016, 11:14:56 AM9/13/16
to django-...@googlegroups.com
#27217: makemigrations crashes with "'SpatialRefSysMixin' has no attribute '_meta'"
on PostGIS
---------------------------------+------------------------------------

Reporter: MVSatish | Owner: nobody
Type: Bug | Status: new
Component: GIS | Version: master
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
---------------------------------+------------------------------------
Changes (by timgraham):

* stage: Unreviewed => Accepted


Comment:

Bisected the regression to 7fc4c1db627807874966e4f96b34cff7c9af886f. Steps
to reproduce and a sample project are [https://groups.google.com/d/msg
/django-users/5XHFjuRmJkU/fsReJVrPAQAJ on django-users].

--
Ticket URL: <https://code.djangoproject.com/ticket/27217#comment:2>

Django

unread,
Sep 14, 2016, 3:37:24 AM9/14/16
to django-...@googlegroups.com
#27217: makemigrations crashes with "'SpatialRefSysMixin' has no attribute '_meta'"
on PostGIS
---------------------------------+------------------------------------

Reporter: MVSatish | Owner: nobody
Type: Bug | Status: new
Component: GIS | Version: master
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
---------------------------------+------------------------------------

Comment (by melvyn-sopacua):

Reproduction steps posted on mailing list:

1. Create a python3 virtualenv and activate it
2. pip install git+https://github.com/django/django.git
3. pip install psycopg2
4. django-admin startproject projectname
5. Change the db backend to postgis in settings file
6. python manage.py makemigrations

--
Ticket URL: <https://code.djangoproject.com/ticket/27217#comment:3>

Django

unread,
Sep 14, 2016, 3:44:01 AM9/14/16
to django-...@googlegroups.com
#27217: makemigrations crashes with "'SpatialRefSysMixin' has no attribute '_meta'"
on PostGIS
---------------------------------+------------------------------------

Reporter: MVSatish | Owner: nobody
Type: Bug | Status: new
Component: GIS | Version: master
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
---------------------------------+------------------------------------

Comment (by melvyn-sopacua):

If above steps are accurate, then please verify if adding
'django.contrib.gis' to INSTALLED_APPS (which you haven't done in above
steps) resolves the issue. The
[https://docs.djangoproject.com/en/1.10/ref/contrib/gis/tutorial/#setting-
up documentation] on this is ambiguous. It suggests one can start the dev
server without this step (and probably can), but the GeoDjango framework
is improperly configured at that time.

--
Ticket URL: <https://code.djangoproject.com/ticket/27217#comment:4>

Django

unread,
Sep 14, 2016, 3:47:47 AM9/14/16
to django-...@googlegroups.com
#27217: makemigrations crashes with "'SpatialRefSysMixin' has no attribute '_meta'"
on PostGIS
---------------------------------+------------------------------------

Reporter: MVSatish | Owner: nobody
Type: Bug | Status: new
Component: GIS | Version: master
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
---------------------------------+------------------------------------

Comment (by MVSatish):

I've missed documenting the step, I've added 'django.contrib.gis' to
INSTALLED_APPS. Issue is same.

Replying to [comment:4 melvyn-sopacua]:


> If above steps are accurate, then please verify if adding
'django.contrib.gis' to INSTALLED_APPS (which you haven't done in above
steps) resolves the issue. The
[https://docs.djangoproject.com/en/1.10/ref/contrib/gis/tutorial/#setting-
up documentation] on this is ambiguous. It suggests one can start the dev
server without this step (and probably can), but the GeoDjango framework
is improperly configured at that time.

--
Ticket URL: <https://code.djangoproject.com/ticket/27217#comment:5>

Django

unread,
Sep 14, 2016, 4:36:07 AM9/14/16
to django-...@googlegroups.com
#27217: makemigrations crashes with "'SpatialRefSysMixin' has no attribute '_meta'"
on PostGIS
---------------------------------+------------------------------------

Reporter: MVSatish | Owner: nobody
Type: Bug | Status: new
Component: GIS | Version: master
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
---------------------------------+------------------------------------
Changes (by claudep):

* cc: sir-sigurd (added)


--
Ticket URL: <https://code.djangoproject.com/ticket/27217#comment:6>

Django

unread,
Sep 20, 2016, 1:54:47 AM9/20/16
to django-...@googlegroups.com
#27217: makemigrations crashes with "'SpatialRefSysMixin' has no attribute '_meta'"
on PostGIS
---------------------------------+------------------------------------

Reporter: MVSatish | Owner: nobody
Type: Bug | Status: new
Component: GIS | Version: master
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
---------------------------------+------------------------------------

Comment (by MVSatish):

Hi,

Is there a patch for this bug?

Thanks.

--
Ticket URL: <https://code.djangoproject.com/ticket/27217#comment:7>

Django

unread,
Sep 20, 2016, 7:55:43 AM9/20/16
to django-...@googlegroups.com
#27217: makemigrations crashes with "'SpatialRefSysMixin' has no attribute '_meta'"
on PostGIS
---------------------------------+------------------------------------

Reporter: MVSatish | Owner: nobody
Type: Bug | Status: new
Component: GIS | Version: master
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
---------------------------------+------------------------------------

Comment (by charettes):

Not so far but it should be only a matter of adjusting
[https://github.com/django/django/blob/911d9f4ed1a39f945769b7198a419850378f9824/django/db/migrations/operations/models.py#L112
this line] to also check for `isinstance(base, models.base.ModelBase)`.

--
Ticket URL: <https://code.djangoproject.com/ticket/27217#comment:8>

Django

unread,
Sep 27, 2016, 9:15:56 PM9/27/16
to django-...@googlegroups.com
#27217: makemigrations crashes with "'SpatialRefSysMixin' has no attribute '_meta'"
on PostGIS
---------------------------------+------------------------------------
Reporter: Satish V Madala | Owner: nobody

Type: Bug | Status: new
Component: GIS | Version: master
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
---------------------------------+------------------------------------
Changes (by Tim Graham):

* has_patch: 0 => 1


Comment:

[https://github.com/django/django/pull/7305 PR]

--
Ticket URL: <https://code.djangoproject.com/ticket/27217#comment:9>

Django

unread,
Sep 28, 2016, 10:05:11 AM9/28/16
to django-...@googlegroups.com
#27217: makemigrations crashes with "'SpatialRefSysMixin' has no attribute '_meta'"
on PostGIS
---------------------------------+------------------------------------
Reporter: Satish V Madala | Owner: nobody
Type: Bug | Status: closed
Component: GIS | Version: master
Severity: Release blocker | Resolution: fixed

Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
---------------------------------+------------------------------------
Changes (by GitHub <noreply@…>):

* status: new => closed
* resolution: => fixed


Comment:

In [changeset:"a44fc008c4e38fadef04021fdba564949f1aee3a" a44fc00]:
{{{
#!CommitTicketReference repository=""
revision="a44fc008c4e38fadef04021fdba564949f1aee3a"
Fixed #27217 -- Fixed crash in CreateModel optimization with models that
use mixins.

Thanks Simon Charette for review.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/27217#comment:10>

Reply all
Reply to author
Forward
0 new messages