summaryrefslogtreecommitdiff
path: root/app/posts
diff options
context:
space:
mode:
authorluxagraf <sng@luxagraf.net>2024-05-09 16:46:51 -0500
committerluxagraf <sng@luxagraf.net>2024-05-09 16:46:51 -0500
commit06085dc492c1d558c0956cad7f3b4b6e39f11187 (patch)
treea8fc667dd39e5d2d7114105dda003e983fb602ae /app/posts
parent36cec3379c541c93740dc50b4f706912edb5b69c (diff)
admin: fixed all the maps to work with django 5 changes
Diffstat (limited to 'app/posts')
-rw-r--r--app/posts/admin.py21
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')