Code

Ticket #4941: tutorial01.diff

File tutorial01.diff, 846 bytes (added by John Shaffer <jshaffer2112@…>, 7 years ago)
Line 
1Index: tutorial01.txt
2===================================================================
3--- tutorial01.txt      (revision 5738)
4+++ tutorial01.txt      (working copy)
5@@ -444,8 +444,8 @@
6     []
7 
8     # Create a new Poll.
9-    >>> from datetime import datetime
10-    >>> p = Poll(question="What's up?", pub_date=datetime.now())
11+    >>> import datetime
12+    >>> p = Poll(question="What's up?", pub_date=datetime.datetime.now())
13 
14     # Save the object into the database. You have to call save() explicitly.
15     >>> p.save()
16@@ -464,7 +464,7 @@
17     datetime.datetime(2005, 7, 15, 12, 00, 53)
18 
19     # Change values by changing the attributes, then calling save().
20-    >>> p.pub_date = datetime(2005, 4, 1, 0, 0)
21+    >>> p.pub_date = datetime.datetime(2005, 4, 1, 0, 0)
22     >>> p.save()
23 
24     # objects.all() displays all the polls in the database.