Changeset 747
- Timestamp:
- 09/30/05 11:40:15 (3 years ago)
- Files:
-
- django/trunk/docs/tutorial01.txt (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/docs/tutorial01.txt
r703 r747 386 386 # keyword arguments. 387 387 >>> polls.get_object(id__exact=1) 388 What's up 388 What's up? 389 389 >>> polls.get_object(question__startswith='What') 390 What's up 390 What's up? 391 391 >>> polls.get_object(pub_date__year=2005) 392 What's up 392 What's up? 393 393 >>> polls.get_object(id__exact=2) 394 394 Traceback (most recent call last): … … 396 396 PollDoesNotExist: Poll does not exist for {'id__exact': 2} 397 397 >>> polls.get_list(question__startswith='What') 398 [What's up ]398 [What's up?] 399 399 400 400 # Lookup by a primary key is the most common case, so Django provides a … … 402 402 # The following is identical to polls.get_object(id__exact=1). 403 403 >>> polls.get_object(pk=1) 404 What's up 404 What's up? 405 405 406 406 # Make sure our custom method worked. … … 420 420 # Choice objects have API access to their related Poll objects. 421 421 >>> c.get_poll() 422 What's up 422 What's up? 423 423 424 424 # And vice versa: Poll objects get access to Choice objects.
