Opened 17 years ago

Closed 17 years ago

Last modified 17 years ago

#5679 closed (fixed)

Can't assign GEOS geometries to a general GeometryField

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

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 17 years ago.

Download all attachments as: .zip

Change History (3)

by Robert Coup, 17 years ago

Attachment: 5679.diff added

comment:1 by jbronn, 17 years ago

Resolution: fixed
Status: newclosed

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

comment:2 by jbronn, 17 years ago

Meant to say fixed in r6467.

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