Opened 18 years ago

Closed 18 years ago

#1912 closed defect (duplicate)

documentation/tutorial1 corrections

Reported by: mikeal@… Owned by: Jacob
Component: Documentation Version:
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

First off, I love the way you guys write documentation.

Some issues with http://www.djangoproject.com/documentation/tutorial1/

  • At this point you should probably change 2005 to 2006
  • once you define Poll.was_published_today() you need to import datetime into your model.
  • the way your example writes Poll.was_published_today() gives me an attribute error (OSX 10.4.6, python 2.4.3),

I believe you want to use is;

def was_published_today(self):
    return self.pub_date.day == datetime.now().day
  • All the shell interaction responses are off (they look like they are in namespaces now), probably because they were changed recently, what I get is
<Choice: Not much>
<Choice: the sky>
<Poll: What's up?>

Change History (1)

comment:1 by Malcolm Tredinnick <malcolm@…>, 18 years ago

Resolution: duplicate
Status: newclosed

Thanks for the comments. A little feedback..

  1. Changing the date seems to not matter very much. It's not that confusing, surely.
  2. We already import datetime, about five lines above where was_published_today is defined in the tutorial.
  3. Your change to was_published_today is only correct if you do from datetime import datetime. We do import datetime and date is a method of the datetime module (and now() is not).
  4. All the shell responses in the tutorial are indeed wrong. There was a patch and then it was postponed temporarily and then it fell through the cracks. This portion (fixing the output) is the last bit of #1724 and that will be fixed shortly.

So I think we can close this one off. But thanks for the feedback, in any case.

Note: See TracTickets for help on using tickets.
Back to Top