Opened 10 years ago

Closed 10 years ago

Last modified 7 years ago

#8558 closed (fixed)

"from django.db import models" missing in tutorial02

Reported by: Jerzy.Ludwichowski@… Owned by: nobody
Component: Documentation Version: master
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


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 Changed 10 years ago by James Bennett

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 Changed 10 years ago by Jerzy.Ludwichowski@…

Resolution: invalid
Status: closedreopened

The code snippet (for 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 ( models were not imported or am I somehow blinded?

comment:3 Changed 10 years ago by James Bennett

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 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 Changed 10 years ago by Malcolm Tredinnick

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 Changed 10 years ago by Malcolm Tredinnick

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 Changed 7 years ago by Jacob

milestone: 1.0

Milestone 1.0 deleted

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