1
0
mirror of https://github.com/django/django.git synced 2025-06-06 20:19:13 +00:00

magic-removal: Updated docs to reflect new location of django.core.extensions.

git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@2051 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Joseph Kocherhans 2006-01-18 19:03:19 +00:00
parent 471bae17fa
commit 9f4d2d5d27
3 changed files with 4 additions and 4 deletions

View File

@ -65,7 +65,7 @@ Using the ``AddManipulator``
We'll start with the ``AddManipulator``. Here's a very simple view that takes 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:: POSTed data from the browser and creates a new ``Place`` object::
from django.core.extensions import render_to_response from django.shortcuts import render_to_response
from django.http import Http404, HttpResponse, HttpResponseRedirect from django.http import Http404, HttpResponse, HttpResponseRedirect
from django.models.places import places from django.models.places import places
from django import forms from django import forms

View File

@ -254,7 +254,7 @@ It's a very common idiom to load a template, fill a context and return an
``HttpResponse`` object with the result of the rendered template. Django ``HttpResponse`` object with the result of the rendered template. Django
provides a shortcut. Here's the full ``index()`` view, rewritten:: provides a shortcut. Here's the full ``index()`` view, rewritten::
from django.core.extensions import render_to_response from django.shortcuts import render_to_response
from django.models.polls import polls from django.models.polls import polls
def index(request): def index(request):
@ -292,7 +292,7 @@ It's a very common idiom to use ``get_object()`` and raise ``Http404`` if the
object doesn't exist. Django provides a shortcut. Here's the ``detail()`` view, object doesn't exist. Django provides a shortcut. Here's the ``detail()`` view,
rewritten:: rewritten::
from django.core.extensions import get_object_or_404 from django.shortcuts import get_object_or_404
def detail(request, poll_id): def detail(request, poll_id):
p = get_object_or_404(polls, pk=poll_id) p = get_object_or_404(polls, pk=poll_id)
return render_to_response('polls/detail', {'poll': p}) return render_to_response('polls/detail', {'poll': p})

View File

@ -48,7 +48,7 @@ included this line::
So let's create a ``vote()`` function in ``myproject/polls/views.py``:: So let's create a ``vote()`` function in ``myproject/polls/views.py``::
from django.core.extensions import get_object_or_404, render_to_response from django.shortcuts import get_object_or_404, render_to_response
from django.models.polls import choices, polls from django.models.polls import choices, polls
from django.http import HttpResponseRedirect from django.http import HttpResponseRedirect