Opened 10 years ago

Closed 10 years ago

#6357 closed (fixed)

'unicode' object has no attribute 'wkt'

Reported by: sheats@… Owned by: jbronn
Component: GIS Version: gis
Severity: Keywords: gis admin wkt
Cc: jbronn@… Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


Using the GIS branch...

When you save an object in the admin that is spatially enabled the error "'unicode' object has no attribute 'wkt'" is thrown when there is a field validation error on another field. For example, if you have a URLField and a MultipolygonField on a model and try to save an object with an invalid URL in the URLField you'll get the error. Here are the details:

Template error:
In template /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/django/contrib/admin/templates/widget/default.html, error at line 1

Caught an exception while rendering: 'unicode' object has no attribute 'wkt'
1 : {% load admin_modify %} {% output_all bound_field.form_fields %}

2 :

File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/django/template/" in render_node

  1. result = node.render(context)

File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/django/template/" in render

  1. return func(*resolved_vars)

File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/django/contrib/admin/templatetags/" in output_all

  1. return u.join([force_unicode(f) for f in form_fields])

File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/django/utils/" in force_unicode

  1. s = unicode(s)

File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/django/oldforms/" in unicode

  1. return force_unicode(self.formfield.render(

File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/django/contrib/gis/oldforms/" in render

  1. return super(WKTField, self).render(data.wkt)

Exception Type: AttributeError at /admin/schools/school/1257/
Exception Value: 'unicode' object has no attribute 'wkt'

Change History (3)

comment:1 Changed 10 years ago by Simon Greenhill <dev@…>

Triage Stage: UnreviewedAccepted
Version: SVNgis

comment:2 Changed 10 years ago by jbronn

Cc: jbronn@… added
Keywords: gis admin wkt added
Owner: changed from nobody to jbronn
Status: newassigned

The traceback suggests this is a bug. Thanks!

comment:3 Changed 10 years ago by jbronn

Resolution: fixed
Status: assignedclosed

(In [7026]) gis: Fixed #6357, and added a validator to WKTField.

Note: See TracTickets for help on using tickets.
Back to Top