Closed mapperfr closed 2 years ago
Try using GeoModelAdminMixin
with NestedModelAdmin
, something like:
from django.contrib.gis.admin.options import GeoModelAdminMixin
class MyModelAdmin(GeoModelAdminMixin, nested_admin.NestedModelAdmin):
# ...
Thanks @fdintino, it works as expected now. Now I need to learn about those Mixins :)
On admin.py, my main model admin class is an OSMGeoAdmin from Geodjango (recently upgraded to a GISModelAdmin with Django 4). It allows me to display an OpenStreetMap map window on a point field from the model. If I switch to NestedModelAdmin, as needed to display the nested models in my main model admin, the Leaflet map window is still here but I lose the OSM map tiles. It's lilke django-nested-admin and Geodjango are not compatibles.