[Django] #26788: update of geometry field from the another one crashes

10 views
Skip to first unread message

Django

unread,
Jun 21, 2016, 4:22:21 PM6/21/16
to django-...@googlegroups.com
#26788: update of geometry field from the another one crashes
----------------------------+--------------------
Reporter: sir-sigurd | Owner: nobody
Type: Bug | Status: new
Component: GIS | Version: 1.9
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
----------------------------+--------------------
{{{#!python
class City(models.Model):
point = models.PointField(srid=4326)
point2 = models.PointField(srid=3857, null=True)
}}}


{{{#!python
City.objects.update(point2=models.F('point'))
}}}

{{{#!python
<ipython-input-7-e6630ea1824e> in <module>()
----> 1 City.objects.update(point2=models.F('point'))

/home/sergey/dev/django/django/db/models/manager.pyc in
manager_method(self, *args, **kwargs)
83 def create_method(name, method):
84 def manager_method(self, *args, **kwargs):
---> 85 return getattr(self.get_queryset(), name)(*args,
**kwargs)
86 manager_method.__name__ = method.__name__
87 manager_method.__doc__ = method.__doc__

/home/sergey/dev/django/django/db/models/query.pyc in update(self,
**kwargs)
634 query.add_update_values(kwargs)
635 with transaction.atomic(using=self.db, savepoint=False):
--> 636 rows = query.get_compiler(self.db).execute_sql(CURSOR)
637 self._result_cache = None
638 return rows

/home/sergey/dev/django/django/db/models/sql/compiler.pyc in
execute_sql(self, result_type)
1146 related queries are not available.
1147 """
-> 1148 cursor = super(SQLUpdateCompiler,
self).execute_sql(result_type)
1149 try:
1150 rows = cursor.rowcount if cursor else 0

/home/sergey/dev/django/django/db/models/sql/compiler.pyc in
execute_sql(self, result_type)
822 result_type = NO_RESULTS
823 try:
--> 824 sql, params = self.as_sql()
825 if not sql:
826 raise EmptyResultSet

/home/sergey/dev/django/django/db/models/sql/compiler.pyc in as_sql(self)
1114 # Getting the placeholder for the field.
1115 if hasattr(field, 'get_placeholder'):
-> 1116 placeholder = field.get_placeholder(val, self,
self.connection)
1117 else:
1118 placeholder = '%s'

/home/sergey/dev/django/django/contrib/gis/db/models/fields.pyc in
get_placeholder(self, value, compiler, connection)
159 given value.
160 """
--> 161 return connection.ops.get_geom_placeholder(self, value,
compiler)
162
163 def get_srid(self, obj):

/home/sergey/dev/django/django/contrib/gis/db/backends/postgis/operations.pyc
in get_geom_placeholder(self, f, value, compiler)
338 value_srid = get_pgraster_srid(value)
339 else:
--> 340 value_srid = value.srid
341
342 # Adding Transform() to the SQL placeholder if the value
srid

AttributeError: 'Col' object has no attribute 'srid'
}}}

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

Django

unread,
Jun 21, 2016, 4:22:32 PM6/21/16
to django-...@googlegroups.com
#26788: update of geometry field from the another one crashes
----------------------------+--------------------------------------
Reporter: sir-sigurd | Owner: sir-sigurd
Type: Bug | Status: assigned
Component: GIS | Version: 1.9
Severity: Normal | 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 sir-sigurd):

* owner: nobody => sir-sigurd
* status: new => assigned
* needs_docs: => 0
* needs_tests: => 0
* needs_better_patch: => 0


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

Django

unread,
Jun 22, 2016, 6:54:18 AM6/22/16
to django-...@googlegroups.com
#26788: update of geometry field from the another one crashes
----------------------------+--------------------------------------
Reporter: sir-sigurd | Owner: sir-sigurd
Type: Bug | Status: assigned
Component: GIS | Version: 1.9
Severity: Normal | 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


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

Django

unread,
Dec 10, 2016, 4:24:56 AM12/10/16
to django-...@googlegroups.com
#26788: update of geometry field from the another one crashes
-------------------------------------+-------------------------------------
Reporter: Sergey Fedoseev | Owner: Sergey
| Fedoseev
Type: Bug | Status: assigned
Component: GIS | Version: 1.9

Severity: Normal | 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 Sergey Fedoseev):

* has_patch: 0 => 1


Comment:

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

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

Django

unread,
Dec 10, 2016, 6:47:17 AM12/10/16
to django-...@googlegroups.com
#26788: update of geometry field from the another one crashes
-------------------------------------+-------------------------------------
Reporter: Sergey Fedoseev | Owner: Sergey
| Fedoseev
Type: Bug | Status: assigned
Component: GIS | Version: 1.9

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

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

* needs_better_patch: 0 => 1


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

Django

unread,
Mar 7, 2017, 4:41:21 AM3/7/17
to django-...@googlegroups.com
#26788: update of geometry field from the another one crashes
-------------------------------------+-------------------------------------
Reporter: Sergey Fedoseev | Owner: Sergey
| Fedoseev
Type: Bug | Status: assigned
Component: GIS | Version: 1.9

Severity: Normal | 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 Sergey Fedoseev):

* needs_better_patch: 1 => 0
* has_patch: 1 => 0


Comment:

My patch should be reworked, I will try do it in the near future.

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

Django

unread,
Mar 21, 2017, 4:03:19 AM3/21/17
to django-...@googlegroups.com
#26788: update of geometry field from the another one crashes
-------------------------------------+-------------------------------------
Reporter: Sergey Fedoseev | Owner: Sergey
| Fedoseev
Type: Bug | Status: assigned
Component: GIS | Version: 1.9

Severity: Normal | 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 Sergey Fedoseev):

* has_patch: 0 => 1


Comment:

[https://github.com/django/django/pull/7674 PR] is updated.

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

Django

unread,
Apr 1, 2017, 6:44:31 PM4/1/17
to django-...@googlegroups.com
#26788: update of geometry field from the another one crashes
-------------------------------------+-------------------------------------
Reporter: Sergey Fedoseev | Owner: Sergey
| Fedoseev
Type: Bug | Status: assigned
Component: GIS | Version: 1.9

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

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

* needs_better_patch: 0 => 1


Comment:

A couple of Oracle failures remain.

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

Django

unread,
Apr 2, 2017, 7:49:40 AM4/2/17
to django-...@googlegroups.com
#26788: update of geometry field from the another one crashes
-------------------------------------+-------------------------------------
Reporter: Sergey Fedoseev | Owner: Sergey
| Fedoseev
Type: Bug | Status: assigned
Component: GIS | Version: 1.9

Severity: Normal | 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 Sergey Fedoseev):

* needs_better_patch: 1 => 0


Comment:

These failures are fixed now.

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

Django

unread,
Apr 2, 2017, 5:06:52 PM4/2/17
to django-...@googlegroups.com
#26788: update of geometry field from the another one crashes
-------------------------------------+-------------------------------------
Reporter: Sergey Fedoseev | Owner: Sergey
| Fedoseev
Type: Bug | Status: assigned
Component: GIS | Version: 1.9
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin

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

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

* stage: Accepted => Ready for checkin


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

Django

unread,
Apr 10, 2017, 1:26:41 PM4/10/17
to django-...@googlegroups.com
#26788: update of geometry field from the another one crashes
-------------------------------------+-------------------------------------
Reporter: Sergey Fedoseev | Owner: Sergey
| Fedoseev
Type: Bug | Status: closed
Component: GIS | Version: 1.9
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham <timograham@…>):

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


Comment:

In [changeset:"e7afef13f594eb667f2709c0ef7bca98452ab32b" e7afef1]:
{{{
#!CommitTicketReference repository=""
revision="e7afef13f594eb667f2709c0ef7bca98452ab32b"
Fixed #26788 -- Fixed QuerySet.update() crash when updating a geometry to
another one.
}}}

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

Reply all
Reply to author
Forward
0 new messages