Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

magic-removal: fixed #1666 render_to_response '.html' updates for doc…

…umentation. Thanks SmileyChris

git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@2721 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit c3b7f4b0a9df9ade5d7a11fe07b554579d0d9f73 1 parent 0121e4c
Joseph Kocherhans authored April 21, 2006
10  docs/forms.txt
@@ -110,7 +110,7 @@ view with a form that submits to this flawed creation view::
110 110
         # Create a FormWrapper object that the template can use. Ignore
111 111
         # the last two arguments to FormWrapper for now.
112 112
         form = forms.FormWrapper(places.AddManipulator(), {}, {})
113  
-        return render_to_response('places/naive_create_form', {'form': form})
  113
+        return render_to_response('places/naive_create_form.html', {'form': form})
114 114
 
115 115
 (This view, as well as all the following ones, has the same imports as in the
116 116
 first example above.)
@@ -161,7 +161,7 @@ creation view that takes validation into account::
161 161
         # Check for validation errors
162 162
         errors = manipulator.get_validation_errors(new_data)
163 163
         if errors:
164  
-            return render_to_response('places/errors', {'errors': errors})
  164
+            return render_to_response('places/errors.html', {'errors': errors})
165 165
         else:
166 166
             manipulator.do_html2python(request.POST)
167 167
             new_place = manipulator.save(request.POST)
@@ -233,7 +233,7 @@ Below is the finished view::
233 233
 
234 234
         # Create the FormWrapper, template, context, response.
235 235
         form = forms.FormWrapper(manipulator, new_data, errors)
236  
-        return render_to_response('places/create_form', {'form': form})
  236
+        return render_to_response('places/create_form.html', {'form': form})
237 237
 
238 238
 and here's the ``create_form`` template::
239 239
 
@@ -322,7 +322,7 @@ about editing an existing one? It's shockingly similar to creating a new one::
322 322
             new_data = place.__dict__
323 323
 
324 324
         form = forms.FormWrapper(manipulator, new_data, errors)
325  
-        return render_to_response('places/edit_form', {'form': form, 'place': place})
  325
+        return render_to_response('places/edit_form.html', {'form': form, 'place': place})
326 326
 
327 327
 The only real differences are:
328 328
 
@@ -401,7 +401,7 @@ Here's a simple function that might drive the above form::
401 401
         else:
402 402
             errors = new_data = {}
403 403
         form = forms.FormWrapper(manipulator, new_data, errors)
404  
-        return render_to_response('contact_form', {'form': form})
  404
+        return render_to_response('contact_form.html', {'form': form})
405 405
 
406 406
 Validators
407 407
 ==========
2  docs/overview.txt
@@ -198,7 +198,7 @@ article_detail from above::
198 198
     def article_detail(request, year, month, article_id):
199 199
         # Use the Django API to find an object matching the URL criteria.
200 200
         a = get_object_or_404(articles, pub_date__year=year, pub_date__month=month, pk=article_id)
201  
-        return render_to_response('news/article_detail', {'article': a})
  201
+        return render_to_response('news/article_detail.html', {'article': a})
202 202
 
203 203
 This example uses Django's template system, which has several key features.
204 204
 
2  docs/sessions.txt
@@ -141,7 +141,7 @@ Here's a typical usage example::
141 141
             else:
142 142
                 return HttpResponse("Please enable cookies and try again.")
143 143
         request.session.set_test_cookie()
144  
-        return render_to_response('foo/login_form')
  144
+        return render_to_response('foo/login_form.html')
145 145
 
146 146
 Using sessions out of views
147 147
 ===========================
2  docs/tutorial04.txt
@@ -101,7 +101,7 @@ page for the poll. Let's write that view::
101 101
 
102 102
     def results(request, poll_id):
103 103
         p = get_object_or_404(Poll, pk=poll_id)
104  
-        return render_to_response('polls/results', {'poll': p})
  104
+        return render_to_response('polls/results.html', {'poll': p})
105 105
 
106 106
 This is almost exactly the same as the ``detail()`` view from `Tutorial 3`_.
107 107
 The only difference is the template name. We'll fix this redundancy later.

0 notes on commit c3b7f4b

Please sign in to comment.
Something went wrong with that request. Please try again.