summaryrefslogtreecommitdiff
path: root/docs/tutorial03.txt
diff options
context:
space:
mode:
authorChristopher Long <indirecthit@gmail.com>2006-10-27 02:11:46 +0000
committerChristopher Long <indirecthit@gmail.com>2006-10-27 02:11:46 +0000
commitf6fa1032968d8baaf2a30f8478793e8592c72c72 (patch)
tree00a0ceed348fb68e15575f70621749210d8f0968 /docs/tutorial03.txt
parent3f60a8e98d90c1fce40017a2e01b0b4643d91bd6 (diff)
[per-object-permissions] Merged to trunk [3938]
git-svn-id: http://code.djangoproject.com/svn/django/branches/per-object-permissions@3940 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs/tutorial03.txt')
-rw-r--r--docs/tutorial03.txt4
1 files changed, 2 insertions, 2 deletions
diff --git a/docs/tutorial03.txt b/docs/tutorial03.txt
index 248d234043..c4c1b4c546 100644
--- a/docs/tutorial03.txt
+++ b/docs/tutorial03.txt
@@ -91,7 +91,7 @@ Finally, it calls that ``detail()`` function like so::
The ``poll_id='23'`` part comes from ``(?P<poll_id>\d+)``. Using parenthesis around a
pattern "captures" the text matched by that pattern and sends it as an argument
to the view function; the ``?P<poll_id>`` defines the name that will be used to
-identify the matched pattern; and ``\d+`` is a regular experession to match a sequence of
+identify the matched pattern; and ``\d+`` is a regular expression to match a sequence of
digits (i.e., a number).
Because the URL patterns are regular expressions, there really is no limit on
@@ -257,7 +257,7 @@ provides a shortcut. Here's the full ``index()`` view, rewritten::
from mysite.polls.models import Poll
def index(request):
- latest_poll_list = Poll.objects.all().order_by('-pub_date')
+ latest_poll_list = Poll.objects.all().order_by('-pub_date')[:5]
return render_to_response('polls/index.html', {'latest_poll_list': latest_poll_list})
Note that we no longer need to import ``loader``, ``Context`` or