From d162b0bcd8367cc2ddf1ccd613a80a2e82c3b262 Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Tue, 22 Dec 2015 10:21:24 -0500 Subject: [1.9.x] Fixed #25969 -- Replaced render_to_response() with render() in docs examples. Backport of 4d83b0163e15f8352fd17fa121e929842ff2b686 from master --- django/contrib/gis/maps/google/__init__.py | 2 +- django/contrib/gis/maps/google/overlays.py | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) (limited to 'django') diff --git a/django/contrib/gis/maps/google/__init__.py b/django/contrib/gis/maps/google/__init__.py index 3de7366eff..682e88d5ce 100644 --- a/django/contrib/gis/maps/google/__init__.py +++ b/django/contrib/gis/maps/google/__init__.py @@ -7,7 +7,7 @@ Example: * In the view: - return render_to_response('template.html', {'google' : GoogleMap(key="abcdefg")}) + return render(request, 'template.html', {'google': GoogleMap(key="abcdefg")}) * In the template: diff --git a/django/contrib/gis/maps/google/overlays.py b/django/contrib/gis/maps/google/overlays.py index 51247ea47d..3a1c9d4219 100644 --- a/django/contrib/gis/maps/google/overlays.py +++ b/django/contrib/gis/maps/google/overlays.py @@ -24,7 +24,7 @@ class GEvent(object): Example: - from django.shortcuts import render_to_response + from django.shortcuts import render from django.contrib.gis.maps.google import GoogleMap, GEvent, GPolyline def sample_request(request): @@ -32,8 +32,9 @@ class GEvent(object): event = GEvent('click', 'function() { location.href = "http://www.google.com"}') polyline.add_event(event) - return render_to_response('mytemplate.html', - {'google' : GoogleMap(polylines=[polyline])}) + return render(request, 'mytemplate.html', { + 'google': GoogleMap(polylines=[polyline]), + }) """ def __init__(self, event, action): @@ -271,7 +272,7 @@ class GMarker(GOverlayBase): Example: - from django.shortcuts import render_to_response + from django.shortcuts import render from django.contrib.gis.maps.google.overlays import GMarker, GEvent def sample_request(request): @@ -279,8 +280,9 @@ class GMarker(GOverlayBase): event = GEvent('click', 'function() { location.href = "http://www.google.com"}') marker.add_event(event) - return render_to_response('mytemplate.html', - {'google' : GoogleMap(markers=[marker])}) + return render(request, 'mytemplate.html', { + 'google': GoogleMap(markers=[marker]), + }) """ def __init__(self, geom, title=None, draggable=False, icon=None): """ -- cgit v1.3