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:
parent
471bae17fa
commit
9f4d2d5d27
|
@ -65,7 +65,7 @@ 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.extensions import render_to_response
|
||||
from django.shortcuts import render_to_response
|
||||
from django.http import Http404, HttpResponse, HttpResponseRedirect
|
||||
from django.models.places import places
|
||||
from django import forms
|
||||
|
|
|
@ -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
|
||||
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
|
||||
|
||||
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,
|
||||
rewritten::
|
||||
|
||||
from django.core.extensions import get_object_or_404
|
||||
from django.shortcuts import get_object_or_404
|
||||
def detail(request, poll_id):
|
||||
p = get_object_or_404(polls, pk=poll_id)
|
||||
return render_to_response('polls/detail', {'poll': p})
|
||||
|
|
|
@ -48,7 +48,7 @@ included this line::
|
|||
|
||||
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.http import HttpResponseRedirect
|
||||
|
||||
|
|
Loading…
Reference in New Issue