#25708: cannot annotate with geometry value
-------------------------------+--------------------
     Reporter:  sir-sigurd     |      Owner:  nobody
         Type:  Uncategorized  |     Status:  new
    Component:  GIS            |    Version:  1.8
     Severity:  Normal         |   Keywords:
 Triage Stage:  Unreviewed     |  Has patch:  0
Easy pickings:  0              |      UI/UX:  0
-------------------------------+--------------------
 {{{
 In [4]: Test.objects.annotate(p=Value(Point(1,1),
 output_field=GeometryField()))
 Out[4]:
 ---------------------------------------------------------------------------
 ProgrammingError                          Traceback (most recent call
 last)
 /home/sergey/tmp/django-venv/local/lib/python2.7/site-
 packages/IPython/core/formatters.pyc in __call__(self, obj)
     693                 type_pprinters=self.type_printers,
     694                 deferred_pprinters=self.deferred_printers)
 --> 695             printer.pretty(obj)
     696             printer.flush()
     697             return stream.getvalue()

 /home/sergey/tmp/django-venv/local/lib/python2.7/site-
 packages/IPython/lib/pretty.pyc in pretty(self, obj)
     399                             if callable(meth):
     400                                 return meth(obj, self, cycle)
 --> 401             return _default_pprint(obj, self, cycle)
     402         finally:
     403             self.end_group()

 /home/sergey/tmp/django-venv/local/lib/python2.7/site-
 packages/IPython/lib/pretty.pyc in _default_pprint(obj, p, cycle)
     519     if _safe_getattr(klass, '__repr__', None) not in
 _baseclass_reprs:
     520         # A user-provided repr. Find newlines and replace them
 with p.break_()
 --> 521         _repr_pprint(obj, p, cycle)
     522         return
     523     p.begin_group(1, '<')

 /home/sergey/tmp/django-venv/local/lib/python2.7/site-
 packages/IPython/lib/pretty.pyc in _repr_pprint(obj, p, cycle)
     701     """A pprint that just redirects to the normal repr
 function."""
     702     # Find newlines and replace them with p.break_()
 --> 703     output = repr(obj)
     704     for idx,output_line in enumerate(output.splitlines()):
     705         if idx:

 /home/sergey/dev/django/django/db/models/query.pyc in __repr__(self)
     232
     233     def __repr__(self):
 --> 234         data = list(self[:REPR_OUTPUT_SIZE + 1])
     235         if len(data) > REPR_OUTPUT_SIZE:
     236             data[-1] = "...(remaining elements truncated)..."

 /home/sergey/dev/django/django/db/models/query.pyc in __iter__(self)
     256                - Responsible for turning the rows into model
 objects.
     257         """
 --> 258         self._fetch_all()
     259         return iter(self._result_cache)
     260

 /home/sergey/dev/django/django/db/models/query.pyc in _fetch_all(self)
    1072     def _fetch_all(self):
    1073         if self._result_cache is None:
 -> 1074             self._result_cache = list(self.iterator())
    1075         if self._prefetch_related_lookups and not
 self._prefetch_done:
    1076             self._prefetch_related_objects()

 /home/sergey/dev/django/django/db/models/query.pyc in __iter__(self)
      50         # Execute the query. This will also fill compiler.select,
 klass_info,
      51         # and annotations.
 ---> 52         results = compiler.execute_sql()
      53         select, klass_info, annotation_col_map = (compiler.select,
 compiler.klass_info,
      54
 compiler.annotation_col_map)

 /home/sergey/dev/django/django/db/models/sql/compiler.pyc in
 execute_sql(self, result_type)
     837         cursor = self.connection.cursor()
     838         try:
 --> 839             cursor.execute(sql, params)
     840         except Exception:
     841             cursor.close()

 /home/sergey/dev/django/django/db/backends/utils.pyc in execute(self, sql,
 params)
      77         start = time()
      78         try:
 ---> 79             return super(CursorDebugWrapper, self).execute(sql,
 params)
      80         finally:
      81             stop = time()

 /home/sergey/dev/django/django/db/backends/utils.pyc in execute(self, sql,
 params)
      62                 return self.cursor.execute(sql)
      63             else:
 ---> 64                 return self.cursor.execute(sql, params)
      65
      66     def executemany(self, sql, param_list):

 /home/sergey/dev/django/django/db/utils.pyc in __exit__(self, exc_type,
 exc_value, traceback)
      90                 if dj_exc_type not in (DataError, IntegrityError):
      91                     self.wrapper.errors_occurred = True
 ---> 92                 six.reraise(dj_exc_type, dj_exc_value, traceback)
      93
      94     def __call__(self, func):

 /home/sergey/dev/django/django/db/backends/utils.pyc in execute(self, sql,
 params)
      62                 return self.cursor.execute(sql)
      63             else:
 ---> 64                 return self.cursor.execute(sql, params)
      65
      66     def executemany(self, sql, param_list):

 ProgrammingError: can't adapt type 'Point'
 }}}

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

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/053.aa30cdec4b309f44255ad340031648dd%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to