Opened 16 years ago

Closed 16 years ago

Last modified 13 years ago

#8558 closed (fixed)

"from django.db import models" missing in tutorial02

Reported by: Jerzy.Ludwichowski@… 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 James Bennett, 16 years ago

Resolution: invalid
Status: newclosed

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.

comment:2 by Jerzy.Ludwichowski@…, 16 years ago

Resolution: invalid
Status: closedreopened

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 James Bennett, 16 years ago

Resolution: invalid
Status: reopenedclosed

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 Malcolm Tredinnick, 16 years ago

milestone: 1.0
Resolution: invalid
Status: closedreopened
Triage Stage: UnreviewedAccepted

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 Malcolm Tredinnick, 16 years ago

Resolution: fixed
Status: reopenedclosed

(In [8584]) Fixed #8558 -- Removed a stray line in tutorial 2 left over from when it was
rewritten for the new admin.

comment:6 by Jacob, 13 years ago

milestone: 1.0

Milestone 1.0 deleted

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