summaryrefslogtreecommitdiff
path: root/app/utils/widgets.py
diff options
context:
space:
mode:
authorluxagraf <sng@luxagraf.net>2016-01-27 19:02:19 -0500
committerluxagraf <sng@luxagraf.net>2016-01-27 19:02:19 -0500
commit84e4e4876890d3eb670c76ccdb5111741a95c315 (patch)
tree4a27f9aa3f4fdfb1873bdd552b1fd233fe2738fd /app/utils/widgets.py
parent45b7cf38679a55201acf066dc362e1e1c4fcbc9b (diff)
created a generic geoadmin class with some sane defaults and eliminated
a non TLS file in admin
Diffstat (limited to 'app/utils/widgets.py')
-rw-r--r--app/utils/widgets.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/app/utils/widgets.py b/app/utils/widgets.py
index 90a0505..6d6a334 100644
--- a/app/utils/widgets.py
+++ b/app/utils/widgets.py
@@ -2,6 +2,7 @@ import os
from django import forms
from django.contrib import admin
from django.contrib.admin.widgets import AdminFileWidget
+from django.contrib.gis.admin import OSMGeoAdmin
from django.utils.safestring import mark_safe
from django.utils.translation import ugettext_lazy as _
from django.conf import settings
@@ -91,3 +92,15 @@ class LGEntryForm(forms.ModelForm):
widgets = {
'body_markdown': forms.Textarea(attrs={'rows': 50, 'cols': 100}),
}
+
+
+class OLAdminBase(OSMGeoAdmin):
+ default_lon = -9285175
+ default_lat = 4025046
+ default_zoom = 15
+ units = True
+ scrollable = False
+ map_width = 700
+ map_height = 425
+ map_template = 'gis/admin/osm.html'
+ openlayers_url = '/static/admin/js/OpenLayers.js'