Opened 4 years ago

Closed 4 years ago

#14561 closed (invalid)

Missing step in tutorial

Reported by: leftcase Owned by: elbarto
Component: Documentation Version: 1.2
Severity: Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

In docs.djangoproject.com/en/1.2/intro/tutorial01/

This step could be seen as being confusing:

Wait a minute. <Poll: Poll object> is, utterly, an unhelpful representation of this object. Let's fix that by editing the polls model (in the polls/models.py file) and adding a unicode() method to both Poll and Choice:

If you try to do this step by step you will find that editing the models.py file as suggested and retrying:

Poll.objects.all()

Still returns:

[<Poll: Poll object>]

It might be an idea to add a step instructing the user to start a new Python interactive shell by exiting and then running python manage.py shell again. It seems to me that if you don't do this first then Poll.objects.all() will always return [<Poll: Poll object>] no matter what you change in the models.py file until you start a new interactive shell.

This might seem obvious but could trip up a new user.

Change History (3)

comment:1 Changed 4 years ago by kmtracey

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

The step is not missing, it is just further down on the page, after a couple of other points are made. This has been mentioned as a missing step more than once, so it may make sense to move the actual demonstration of the use of the new methods closer to where they are coded. Further at least one of those other points -- the one noting the __unicode__ methods may not work if you are using an old level of Django -- should be removed now. It's been a couple of years+ since you had to be running the latest and greatest dev level from trunk to get unicode support. That note is more confusing than helpful at this point.

comment:2 Changed 4 years ago by elbarto

  • Owner changed from nobody to elbarto

The ticket is obsolete. It were fixed in r10263 and the unicode problem in r14585.

comment:3 Changed 4 years ago by elbarto

  • Resolution set to invalid
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.
Back to Top