diff options
Diffstat (limited to 'django/contrib/gis/admin')
-rw-r--r-- | django/contrib/gis/admin/options.py | 2 | ||||
-rw-r--r-- | django/contrib/gis/admin/widgets.py | 5 |
2 files changed, 3 insertions, 4 deletions
diff --git a/django/contrib/gis/admin/options.py b/django/contrib/gis/admin/options.py index 4b99ddf354..4ae61661d3 100644 --- a/django/contrib/gis/admin/options.py +++ b/django/contrib/gis/admin/options.py @@ -80,7 +80,7 @@ class GeoModelAdmin(ModelAdmin): collection_type = 'None' class OLMap(self.widget): - template = self.map_template + template_name = self.map_template geom_type = db_field.geom_type wms_options = '' diff --git a/django/contrib/gis/admin/widgets.py b/django/contrib/gis/admin/widgets.py index dc556ba964..014b3ad818 100644 --- a/django/contrib/gis/admin/widgets.py +++ b/django/contrib/gis/admin/widgets.py @@ -3,7 +3,6 @@ import logging from django.contrib.gis.gdal import GDALException from django.contrib.gis.geos import GEOSException, GEOSGeometry from django.forms.widgets import Textarea -from django.template import loader from django.utils import six, translation # Creating a template context that contains Django settings @@ -16,7 +15,7 @@ class OpenLayersWidget(Textarea): """ Renders an OpenLayers map using the WKT of the geometry. """ - def render(self, name, value, attrs=None, renderer=None): + def get_context(self, name, value, attrs=None): # Update the template parameters with any attributes passed in. if attrs: self.params.update(attrs) @@ -77,7 +76,7 @@ class OpenLayersWidget(Textarea): self.params['wkt'] = wkt self.params.update(geo_context) - return loader.render_to_string(self.template, self.params) + return self.params def map_options(self): "Builds the map options hash for the OpenLayers template." |