Ticket #4941: tutorial01.diff
File tutorial01.diff, 846 bytes (added by , 17 years ago) |
---|
-
tutorial01.txt
444 444 [] 445 445 446 446 # Create a new Poll. 447 >>> from datetimeimport datetime448 >>> p = Poll(question="What's up?", pub_date=datetime. now())447 >>> import datetime 448 >>> p = Poll(question="What's up?", pub_date=datetime.datetime.now()) 449 449 450 450 # Save the object into the database. You have to call save() explicitly. 451 451 >>> p.save() … … 464 464 datetime.datetime(2005, 7, 15, 12, 00, 53) 465 465 466 466 # Change values by changing the attributes, then calling save(). 467 >>> p.pub_date = datetime (2005, 4, 1, 0, 0)467 >>> p.pub_date = datetime.datetime(2005, 4, 1, 0, 0) 468 468 >>> p.save() 469 469 470 470 # objects.all() displays all the polls in the database.