Opened 7 years ago

Closed 7 years ago

Last modified 3 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: UI/UX:

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

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to invalid
  • Status changed from new to 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.

comment:2 Changed 7 years ago by Jerzy.Ludwichowski@…

  • Resolution invalid deleted
  • Status changed from closed to 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 Changed 7 years ago by ubernostrum

  • Resolution set to invalid
  • Status changed from reopened to 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 Changed 7 years ago by mtredinnick

  • milestone set to 1.0
  • Resolution invalid deleted
  • Status changed from closed to reopened
  • Triage Stage changed from Unreviewed to 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 Changed 7 years ago by mtredinnick

  • Resolution set to fixed
  • Status changed from reopened to closed

(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 3 years ago by jacob

  • milestone 1.0 deleted

Milestone 1.0 deleted

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