Code

Ticket #2592: 2592.diff

File 2592.diff, 2.3 KB (added by Simon G. <dev@…>, 7 years ago)
Line 
1Index: tutorial01.txt
2===================================================================
3--- tutorial01.txt      (revision 4400)
4+++ tutorial01.txt      (working copy)
5@@ -30,7 +30,9 @@
6 
7 From the command line, ``cd`` into a directory where you'd like to store your
8 code, then run the command ``django-admin.py startproject mysite``. This
9-will create a ``mysite`` directory in your current directory.
10+will create a ``mysite`` directory in your current directory. (Quick note: there
11+are a few names you can't use as this will interfere with core parts of Django,
12+``site`` is one of these).
13 
14 (``django-admin.py`` should be on your system path if you installed Django via
15 ``python setup.py``. If it's not on your path, you can find it in
16@@ -81,7 +83,7 @@
17     Validating models...
18     0 errors found.
19 
20-    Django version 0.95, using settings 'mysite.settings'
21+    Django version 0.96-pre, using settings 'mysite.settings'
22     Development server is running at http://127.0.0.1:8000/
23     Quit the server with CONTROL-C (Unix) or CTRL-BREAK (Windows).
24 
25@@ -482,7 +484,7 @@
26 Note the addition of ``import datetime`` to reference Python's standard
27 ``datetime`` module.
28 
29-Let's jump back into the Python interactive shell by running
30+To activate these changes, restart the Python interactive shell by running
31 ``python manage.py shell`` again::
32 
33     >>> from mysite.polls.models import Poll, Choice
34@@ -495,6 +497,7 @@
35     # keyword arguments.
36     >>> Poll.objects.filter(id=1)
37     [<Poll: What's up?>]
38+    # Note: that's TWO underscores after the fieldname "question"
39     >>> Poll.objects.filter(question__startswith='What')
40     [<Poll: What's up?>]
41 
42@@ -519,8 +522,11 @@
43     >>> p.was_published_today()
44     False
45 
46-    # Give the Poll a couple of Choices. The create call constructs a new
47-    # choice object, does the INSERT statement, adds the choice to the set
48+    # Give the Poll a couple of Choices.
49+    # Because the Poll is related to a set of Choices, the Poll object will have
50+    # a choice_set object which stores these. It's currently empty, so let's give
51+    # the Poll a few Choices by using the create call.
52+    # This does the INSERT statement, adds the choice to the set
53     # of available choices and returns the new Choice object.
54     >>> p = Poll.objects.get(pk=1)
55     >>> p.choice_set.create(choice='Not much', votes=0)