Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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
@jkocherhans jkocherhans authored
View
10 docs/forms.txt
@@ -110,7 +110,7 @@ view with a form that submits to this flawed creation view::
# Create a FormWrapper object that the template can use. Ignore
# the last two arguments to FormWrapper for now.
form = forms.FormWrapper(places.AddManipulator(), {}, {})
- return render_to_response('places/naive_create_form', {'form': form})
+ return render_to_response('places/naive_create_form.html', {'form': form})
(This view, as well as all the following ones, has the same imports as in the
first example above.)
@@ -161,7 +161,7 @@ creation view that takes validation into account::
# Check for validation errors
errors = manipulator.get_validation_errors(new_data)
if errors:
- return render_to_response('places/errors', {'errors': errors})
+ return render_to_response('places/errors.html', {'errors': errors})
else:
manipulator.do_html2python(request.POST)
new_place = manipulator.save(request.POST)
@@ -233,7 +233,7 @@ Below is the finished view::
# Create the FormWrapper, template, context, response.
form = forms.FormWrapper(manipulator, new_data, errors)
- return render_to_response('places/create_form', {'form': form})
+ return render_to_response('places/create_form.html', {'form': form})
and here's the ``create_form`` template::
@@ -322,7 +322,7 @@ about editing an existing one? It's shockingly similar to creating a new one::
new_data = place.__dict__
form = forms.FormWrapper(manipulator, new_data, errors)
- return render_to_response('places/edit_form', {'form': form, 'place': place})
+ return render_to_response('places/edit_form.html', {'form': form, 'place': place})
The only real differences are:
@@ -401,7 +401,7 @@ Here's a simple function that might drive the above form::
else:
errors = new_data = {}
form = forms.FormWrapper(manipulator, new_data, errors)
- return render_to_response('contact_form', {'form': form})
+ return render_to_response('contact_form.html', {'form': form})
Validators
==========
View
2  docs/overview.txt
@@ -198,7 +198,7 @@ article_detail from above::
def article_detail(request, year, month, article_id):
# Use the Django API to find an object matching the URL criteria.
a = get_object_or_404(articles, pub_date__year=year, pub_date__month=month, pk=article_id)
- return render_to_response('news/article_detail', {'article': a})
+ return render_to_response('news/article_detail.html', {'article': a})
This example uses Django's template system, which has several key features.
View
2  docs/sessions.txt
@@ -141,7 +141,7 @@ Here's a typical usage example::
else:
return HttpResponse("Please enable cookies and try again.")
request.session.set_test_cookie()
- return render_to_response('foo/login_form')
+ return render_to_response('foo/login_form.html')
Using sessions out of views
===========================
View
2  docs/tutorial04.txt
@@ -101,7 +101,7 @@ page for the poll. Let's write that view::
def results(request, poll_id):
p = get_object_or_404(Poll, pk=poll_id)
- return render_to_response('polls/results', {'poll': p})
+ return render_to_response('polls/results.html', {'poll': p})
This is almost exactly the same as the ``detail()`` view from `Tutorial 3`_.
The only difference is the template name. We'll fix this redundancy later.
Please sign in to comment.
Something went wrong with that request. Please try again.