Opened 7 years ago

Closed 7 years ago

Last modified 5 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: UI/UX:

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 Changed 7 years ago by jbronn

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 Changed 7 years ago by jbronn

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 Changed 7 years ago by jbronn

(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 Changed 5 years ago by Jacob

milestone: 1.2

Milestone 1.2 deleted

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