olwidget icon indicating copy to clipboard operation
olwidget copied to clipboard

Field names concatenated in GeoModelAdmin multiple fields per map

Open GregUK opened this issue 11 years ago • 1 comments

Using Django 1.6.1 with a GeoModelAdmin consisting of two maps. One with 1 geom field and the other with 2 geom fields similar to the exam for country admin shown below.

# admin.py
class CountryAdmin(GeoModelAdmin):
    options = {
        default_lat: -72,
        default_lon: 43,
    }
    maps = (
        (('big_river', 'the_dam'), { 'layers': ['google.streets'] }),
        (('little_stream',), {'overlay_style': {'stroke_color': "#0000ff"}}),
    )

Django returns an error as big_river and the_dam are joined to big_river_the_dam which causes a field lookup error

GregUK avatar Mar 11 '14 08:03 GregUK

Has anyone any idea on how to solve this?

Defining more than one field/overlay in maps will trigger the exception: Unknown field(s) (geom1_geom2_geom3) specified for Testmodel. Check fields/fieldsets/exclude attributes of class TestmodelAdmin.

nieuwenhuys avatar Sep 12 '14 13:09 nieuwenhuys