yourcelf / olwidget

Javascript library to replace textareas that contain WKT data with editable OpenLayers maps, and a django app using it for django forms and admin.
Other
91 stars 44 forks source link

Field names concatenated in GeoModelAdmin multiple fields per map #123

Open GregUK opened 10 years ago

GregUK commented 10 years ago

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

nieuwenhuys commented 9 years ago

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.