From 84e4e4876890d3eb670c76ccdb5111741a95c315 Mon Sep 17 00:00:00 2001 From: luxagraf Date: Wed, 27 Jan 2016 19:02:19 -0500 Subject: created a generic geoadmin class with some sane defaults and eliminated a non TLS file in admin --- app/utils/widgets.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'app/utils/widgets.py') 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' -- cgit v1.2.3-70-g09d2