Django admin embedded with GeoModelAdmin

I have a geodjango application that has Map and Point models in it. I want to be able to add points to the map using the admin interface. The admin interface uses GeoModelAdmin, not ModelAdmin by default. If I want to add inline points, I have to use:

class PointInline(admin.StackedInline):
    model = Point
    extra = 1

I am not sure where I should indicate that I want to use GeoModelAdmin. Any ideas?

Thank!

EDIT:

Just for clarification, here is the relevant part of the admin file:

class MapAdmin(admin.GeoModelAdmin):
    inlines = [PointInline]

admin.site.register(Map, MapAdmin)

I see the form for adding a line, but I get a text area instead of an editable map.

+3
source share
1 answer

Have you tried using OSMGeoAdmin ?

0
source

Source: https://habr.com/ru/post/1786056/


All Articles