diff options
| author | Preston Timmons <prestontimmons@gmail.com> | 2016-12-27 17:00:56 -0500 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2016-12-27 17:50:10 -0500 |
| commit | b52c73008a9d67e9ddbb841872dc15cdd3d6ee01 (patch) | |
| tree | b58a2d18242db5234b18678116e07e6f6bbc7cb3 /django/contrib/gis/admin/widgets.py | |
| parent | 51cde873d9fc8e4540f4efecbd39cfe8e770be38 (diff) | |
Fixed #15667 -- Added template-based widget rendering.
Thanks Carl Meyer and Tim Graham for contributing to the patch.
Diffstat (limited to 'django/contrib/gis/admin/widgets.py')
| -rw-r--r-- | django/contrib/gis/admin/widgets.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/django/contrib/gis/admin/widgets.py b/django/contrib/gis/admin/widgets.py index bf6340d239..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): + 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." |
