{{{#!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.
* 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>
* stage: Unreviewed => Accepted
--
Ticket URL: <https://code.djangoproject.com/ticket/26788#comment:2>
* has_patch: 0 => 1
Comment:
[https://github.com/django/django/pull/7674 PR]
--
Ticket URL: <https://code.djangoproject.com/ticket/26788#comment:3>
* needs_better_patch: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/26788#comment:4>
* 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>
* 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>
* needs_better_patch: 0 => 1
Comment:
A couple of Oracle failures remain.
--
Ticket URL: <https://code.djangoproject.com/ticket/26788#comment:7>
* needs_better_patch: 1 => 0
Comment:
These failures are fixed now.
--
Ticket URL: <https://code.djangoproject.com/ticket/26788#comment:8>
* stage: Accepted => Ready for checkin
--
Ticket URL: <https://code.djangoproject.com/ticket/26788#comment:9>
* 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>