diff options
Diffstat (limited to 'app/posts/admin.py')
-rw-r--r-- | app/posts/admin.py | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/app/posts/admin.py b/app/posts/admin.py index 5c27f64..96883f6 100644 --- a/app/posts/admin.py +++ b/app/posts/admin.py @@ -1,4 +1,5 @@ from django.contrib import admin +from django.contrib.gis.admin import GISModelAdmin from django import forms from django.contrib.contenttypes.admin import GenericStackedInline @@ -10,7 +11,7 @@ from utils.util import get_latlon @admin.register(Post) -class PostAdmin(admin.ModelAdmin): +class PostAdmin(GISModelAdmin): form = LGEntryForm def get_queryset(self, request): @@ -76,15 +77,15 @@ class PostAdmin(admin.ModelAdmin): ) # options for OSM map Using custom ESRI topo map lat, lon = get_latlon() - default_lon = lon - default_lat = lat - default_zoom = 10 - units = True - scrollable = False - map_width = 700 - map_height = 425 - map_template = 'gis/admin/osm.html' - openlayers_url = '/static/admin/js/OpenLayers.js' + gis_widget_kwargs = { + "attrs": { + "default_lon": lon, + "default_lat": lat, + "default_zoom": 6, + "map_width": 700, + "map_height": 425, + } + } class Media: js = ('image-loader.js', 'next-prev-links.js') |