From c4b139eabd33613f928395c168aeee05a645ad5d Mon Sep 17 00:00:00 2001 From: Joseph Kocherhans Date: Wed, 11 Jan 2006 21:58:40 +0000 Subject: [PATCH] magic-removal: Updated docs to reflect new location of django.exceptions.Http404 git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@1918 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- docs/forms.txt | 3 +-- docs/tutorial03.txt | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/docs/forms.txt b/docs/forms.txt index d7d3dd7c5f..ba8b2e8b7d 100644 --- a/docs/forms.txt +++ b/docs/forms.txt @@ -65,9 +65,8 @@ Using the ``AddManipulator`` We'll start with the ``AddManipulator``. Here's a very simple view that takes POSTed data from the browser and creates a new ``Place`` object:: - from django.core.exceptions import Http404 from django.core.extensions import render_to_response - from django.http import HttpResponse, HttpResponseRedirect + from django.http import Http404, HttpResponse, HttpResponseRedirect from django.models.places import places from django.core import formfields diff --git a/docs/tutorial03.txt b/docs/tutorial03.txt index 58c5ece244..6317ce53d4 100644 --- a/docs/tutorial03.txt +++ b/docs/tutorial03.txt @@ -274,7 +274,7 @@ Raising 404 Now, let's tackle the poll detail view -- the page that displays the question for a given poll. Here's the view:: - from django.core.exceptions import Http404 + from django.http import Http404 def detail(request, poll_id): try: p = polls.get_object(pk=poll_id) @@ -282,7 +282,7 @@ for a given poll. Here's the view:: raise Http404 return render_to_response('polls/detail', {'poll': p}) -The new concept here: The view raises the ``django.core.exceptions.Http404`` +The new concept here: The view raises the ``django.http.Http404`` exception if a poll with the requested ID doesn't exist. A shortcut: get_object_or_404()