Code

Opened 5 years ago

Closed 5 years ago

Last modified 3 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

Attachments (0)

Change History (4)

comment:1 Changed 5 years ago by jbronn

  • milestone set to 1.2
  • Needs documentation unset
  • Needs tests unset
  • Owner changed from nobody to jbronn
  • Patch needs improvement unset
  • Status changed from new to assigned

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

comment:2 Changed 5 years ago by jbronn

  • Resolution set to fixed
  • Status changed from assigned to closed

(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 5 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 3 years ago by jacob

  • milestone 1.2 deleted

Milestone 1.2 deleted

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.