Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#5679 closed (fixed)

Can't assign GEOS geometries to a general GeometryField

Reported by: Robert Coup Owned by: jbronn
Component: GIS Version: master
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

class MyModel(models.Models, models.GeoMixin):
  geom = models.GeometryField() 
  ...

my.geom=Point(0,1)
>>> cannot set GEOMETRY GeometryProxy with value of type: <class 'django.contrib.gis.geos.geometries.Polygon'>

GeometryProxy checks the geometry type of the new value against that of the field, but it doesn't make a special case for a GEOMETRY column (which can have any sort of geometry assigned).

Attached patch resolves.

Attachments (1)

5679.diff (706 bytes) - added by Robert Coup 9 years ago.

Download all attachments as: .zip

Change History (3)

Changed 9 years ago by Robert Coup

Attachment: 5679.diff added

comment:1 Changed 9 years ago by jbronn

Resolution: fixed
Status: newclosed

Fixed in 6467 (w/tests). Thanks rcoup!

comment:2 Changed 9 years ago by jbronn

Meant to say fixed in r6467.

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