#8558 closed (fixed)
"from django.db import models" missing in tutorial02
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | Documentation | Version: | dev |
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
The 2nd example in section "Adding related objects" in tutorial02 (multiple choices when adding a poll) should be amended by adding "from django.db import models".
Change History (6)
comment:1 by , 16 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
comment:2 by , 16 years ago
Resolution: | invalid |
---|---|
Status: | closed → reopened |
The code snippet (for admin.py) I'm refering to starts with the line:
poll = models.ForeignKey(Poll, edit_inline=models.STACKED, num_in_admin=3)
Up to that point in the tutorial (http://docs.djangoproject.com/en/dev/intro/tutorial02/#adding-related-objects) models were not imported or am I somehow blinded?
comment:3 by , 16 years ago
Resolution: | → invalid |
---|---|
Status: | reopened → closed |
The text you refer to does not exist in the tutorial for the current Django codebase, which is one part of this being invalid.
In the tutorial for the old release, that code is there but there is no need to repeat the import statement; in that version, the code is all in the models.py
file, which has already imported django.db.models
by that point (otherwise none of the previous code in the tutorial would have worked). So that's the other part of this being invalid.
Remember: the tutorial is designed to be worked through in order, from start to finish. Trying to jump in to a point in the middle without doing the previous portions will result in headaches. If you have further problems, please take them to the django-users mailing list, which is the general place for support questions related to using Django.
comment:4 by , 16 years ago
milestone: | → 1.0 |
---|---|
Resolution: | invalid |
Status: | closed → reopened |
Triage Stage: | Unreviewed → Accepted |
The line in question does in fact exist in the tutorial. It's just a bug from the porting process.
People need to be precise when reporting bugs so that we zoom in on the right place (jsut saying "in tutorial 2" is not precise). And then we need to give people a small benefit of the doubt until we can work out the real issue.
comment:5 by , 16 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
This section deals entirely with the admin, and everything necessary to use the admin with the defined models has already been imported by this point in the tutorial.