summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2015-12-22 10:21:24 -0500
committerTim Graham <timograham@gmail.com>2015-12-23 10:50:55 -0500
commitd162b0bcd8367cc2ddf1ccd613a80a2e82c3b262 (patch)
treedf67425e80a07513cdf654d4ea1afc90e9f190d0 /django
parent2f205e073bbcafc3e2708a0d9c70e0727f9916fb (diff)
[1.9.x] Fixed #25969 -- Replaced render_to_response() with render() in docs examples.
Backport of 4d83b0163e15f8352fd17fa121e929842ff2b686 from master
Diffstat (limited to 'django')
-rw-r--r--django/contrib/gis/maps/google/__init__.py2
-rw-r--r--django/contrib/gis/maps/google/overlays.py14
2 files changed, 9 insertions, 7 deletions
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):
"""