Opened 14 years ago
Closed 14 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: | no | UI/UX: | no |
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 by , 14 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:2 by , 14 years ago
Owner: | changed from | to
---|
comment:3 by , 14 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
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.