{{{
File "django/django/db/models/query.py", line 220, in iterator
for row in compiler.results_iter():
File "django/django/db/models/sql/compiler.py", line 709, in
results_iter
for rows in self.execute_sql(MULTI):
File "django/django/db/models/sql/compiler.py", line 772, in execute_sql
sql, params = self.as_sql()
File "django/django/db/models/sql/compiler.py", line 82, in as_sql
out_cols, s_params = self.get_columns(with_col_aliases)
File "django/django/contrib/gis/db/models/sql/compiler.py", line 88, in
get_columns
r = self.get_field_select(field, table, col)
File "django/django/contrib/gis/db/models/sql/compiler.py", line 207, in
get_field_select
field_sel = sel_fmt % self._field_column(field, alias, column)
File "django/django/contrib/gis/db/models/sql/compiler.py", line 248, in
_field_column
self.connection.ops.quote_name(column or field.column))
File "django/django/db/backends/postgresql_psycopg2/operations.py", line
97, in quote_name
if name.startswith('"') and name.endswith('"'):
AttributeError: 'NoneType' object has no attribute 'startswith'
}}}
The backported fix for #21413, commit 0f272629, was the commit that
introduced the bug.
In `get_default_columns`, the GIS sql compiler uses
`get_fields_with_model`:
<https://github.com/django/django/blob/master/django/contrib/gis/db/models/sql/compiler.py#L127>
While the normal compiler uses `get_concrete_fields_with_model`:
<https://github.com/django/django/blob/master/django/db/models/sql/compiler.py#L296>
Changing the GIS compiler to use `get_concrete_fields_with_model` fixes
the issue. I'm not anywhere near familiar enough with this code to get a
minimal test case, so I'm hoping someone else can help and get this fixed.
--
Ticket URL: <https://code.djangoproject.com/ticket/22250>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0
Comment:
I check on master and the same issue exists.
--
Ticket URL: <https://code.djangoproject.com/ticket/22250#comment:1>
* owner: nobody => bak1an
* status: new => assigned
Comment:
I will try to figure out what's going on here.
--
Ticket URL: <https://code.djangoproject.com/ticket/22250#comment:2>
* type: Uncategorized => Bug
* severity: Normal => Release blocker
* stage: Unreviewed => Accepted
--
Ticket URL: <https://code.djangoproject.com/ticket/22250#comment:3>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"21f208e66e6472b8db8cdfd7cd1102d71bb15733"]:
{{{
#!CommitTicketReference repository=""
revision="21f208e66e6472b8db8cdfd7cd1102d71bb15733"
Fixed #22250 -- regression in gis compiler for non-concrete fields
Thanks to gw...@fusionbox.com for the report.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/22250#comment:4>
Comment (by Anssi Kääriäinen <akaariai@…>):
In [changeset:"a6a0800579c806d54af7edd425063be8de4051ab"]:
{{{
#!CommitTicketReference repository=""
revision="a6a0800579c806d54af7edd425063be8de4051ab"
[1.7.x] Fixed #22250 -- regression in gis compiler for non-concrete fields
Thanks to gw...@fusionbox.com for the report.
Backport of 21f208e66e from master
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/22250#comment:5>
Comment (by Anssi Kääriäinen <akaariai@…>):
In [changeset:"31892af3f03fa75dd59a2f70beebb29993098778"]:
{{{
#!CommitTicketReference repository=""
revision="31892af3f03fa75dd59a2f70beebb29993098778"
[1.6.x] Fixed #22250 -- regression in gis compiler for non-concrete fields
Thanks to gw...@fusionbox.com for the report.
Backport of 21f208e66e from master
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/22250#comment:6>
Comment (by Tim Graham <timograham@…>):
In [changeset:"d57ba04d890bab2d5ebe494e5e23d7374d658036"]:
{{{
#!CommitTicketReference repository=""
revision="d57ba04d890bab2d5ebe494e5e23d7374d658036"
Added 1.6.3 release note for refs #22250.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/22250#comment:7>
Comment (by Tim Graham <timograham@…>):
In [changeset:"916f0de74ba00f65cc789c075ce94f7fba858976"]:
{{{
#!CommitTicketReference repository=""
revision="916f0de74ba00f65cc789c075ce94f7fba858976"
[1.6.x] Added 1.6.3 release note for refs #22250.
Backport of d57ba04d89 from master
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/22250#comment:9>
Comment (by Tim Graham <timograham@…>):
In [changeset:"25da849896c86c382da6337e719ef57460a77c85"]:
{{{
#!CommitTicketReference repository=""
revision="25da849896c86c382da6337e719ef57460a77c85"
[1.7.x] Added 1.6.3 release note for refs #22250.
Backport of d57ba04d89 from master
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/22250#comment:8>
Comment (by gwahl@…):
This fix worked for me, thanks.
--
Ticket URL: <https://code.djangoproject.com/ticket/22250#comment:9>