Fixed typo in docs/tutorial01.txt. Thanks, Aggelos Orfanakos
git-svn-id: http://code.djangoproject.com/svn/django/trunk@747 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
acde573821
commit
7cc9526b2e
|
@ -385,23 +385,23 @@ Let's jump back into the Python interactive shell::
|
||||||
# Django provides a rich database lookup API that's entirely driven by
|
# Django provides a rich database lookup API that's entirely driven by
|
||||||
# keyword arguments.
|
# keyword arguments.
|
||||||
>>> polls.get_object(id__exact=1)
|
>>> polls.get_object(id__exact=1)
|
||||||
What's up
|
What's up?
|
||||||
>>> polls.get_object(question__startswith='What')
|
>>> polls.get_object(question__startswith='What')
|
||||||
What's up
|
What's up?
|
||||||
>>> polls.get_object(pub_date__year=2005)
|
>>> polls.get_object(pub_date__year=2005)
|
||||||
What's up
|
What's up?
|
||||||
>>> polls.get_object(id__exact=2)
|
>>> polls.get_object(id__exact=2)
|
||||||
Traceback (most recent call last):
|
Traceback (most recent call last):
|
||||||
...
|
...
|
||||||
PollDoesNotExist: Poll does not exist for {'id__exact': 2}
|
PollDoesNotExist: Poll does not exist for {'id__exact': 2}
|
||||||
>>> polls.get_list(question__startswith='What')
|
>>> polls.get_list(question__startswith='What')
|
||||||
[What's up]
|
[What's up?]
|
||||||
|
|
||||||
# Lookup by a primary key is the most common case, so Django provides a
|
# Lookup by a primary key is the most common case, so Django provides a
|
||||||
# shortcut for primary-key exact lookups.
|
# shortcut for primary-key exact lookups.
|
||||||
# The following is identical to polls.get_object(id__exact=1).
|
# The following is identical to polls.get_object(id__exact=1).
|
||||||
>>> polls.get_object(pk=1)
|
>>> polls.get_object(pk=1)
|
||||||
What's up
|
What's up?
|
||||||
|
|
||||||
# Make sure our custom method worked.
|
# Make sure our custom method worked.
|
||||||
>>> p = polls.get_object(pk=1)
|
>>> p = polls.get_object(pk=1)
|
||||||
|
@ -419,7 +419,7 @@ Let's jump back into the Python interactive shell::
|
||||||
|
|
||||||
# Choice objects have API access to their related Poll objects.
|
# Choice objects have API access to their related Poll objects.
|
||||||
>>> c.get_poll()
|
>>> c.get_poll()
|
||||||
What's up
|
What's up?
|
||||||
|
|
||||||
# And vice versa: Poll objects get access to Choice objects.
|
# And vice versa: Poll objects get access to Choice objects.
|
||||||
>>> p.get_choice_list()
|
>>> p.get_choice_list()
|
||||||
|
|
Loading…
Reference in New Issue