Opened 15 years ago

Closed 15 years ago

Last modified 13 years ago

#12093 closed (fixed)

LayerMapping disregards model inheritance

Reported by: omat@… Owned by: jbronn
Component: GIS Version: 1.1
Severity: Keywords: LayerMapping
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

With 2 models as such:

class Place(models.Model):
    location = models.PointField()

class Hotel(Place):
    name = models.DateTimeField()

While I can import into Place using LayerMapping, when I try to import into Hotel:

mapping = {'name': 'name',
          'location': 'POINT'}
LayerMapping(Hotel, ds, mapping)

I get a:

LayerMapError: Geometry column does not exist for model

It seems like LayerMapping is disregarding model inheritance.

--
omat

Change History (4)

comment:1 by jbronn, 15 years ago

milestone: 1.2
Owner: changed from nobody to jbronn
Status: newassigned

Confirmed using a different model set. Will try and fix this for 1.2.

comment:2 by jbronn, 15 years ago

Resolution: fixed
Status: assignedclosed

(In [11703]) Fixed #12093 -- LayerMapping now takes into account model inheritance when looking for the geometry column; forgot to diable extent regression test on MySQL.

comment:3 by jbronn, 15 years ago

(In [11704]) [1.1.X] Fixed #12093 -- LayerMapping now takes into account model inheritance when looking for the geometry column; forgot to diable extent regression test on MySQL.

Backport of r11703 from trunk.

comment:4 by Jacob, 13 years ago

milestone: 1.2

Milestone 1.2 deleted

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