diff --git a/docs/forms.txt b/docs/forms.txt index 7b6ae5e2c8..8a1a17a120 100644 --- a/docs/forms.txt +++ b/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 ========== diff --git a/docs/overview.txt b/docs/overview.txt index 96c48f32c8..4e8c3bc6c9 100644 --- a/docs/overview.txt +++ b/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. diff --git a/docs/sessions.txt b/docs/sessions.txt index 9d46a1561a..b6b467fd34 100644 --- a/docs/sessions.txt +++ b/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 =========================== diff --git a/docs/tutorial04.txt b/docs/tutorial04.txt index 12947bde02..e67fa632bd 100644 --- a/docs/tutorial04.txt +++ b/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.