Opened 16 years ago

Closed 16 years ago

Last modified 13 years ago

#8181 closed (duplicate)

Documentation error leads to 'model already registered exceptions'

Reported by: Marc 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: UI/UX:

Description

The documentation says to add admin model registration to the end of the models.py file. Because this file may be imported more than once, this causes a 'model _ already registered exception'. The solution is to use autodiscover (as suggested in the documentation) but to place the model registration in the file admin.py.

See http://groups.google.com/group/django-users/browse_thread/thread/8af97d45102ee2f2 .

Change History (7)

comment:1 by Malcolm Tredinnick, 16 years ago

Resolution: invalid
Status: newclosed

I cannot see where in admin.txt we are saying to put the registration in models.py. Please reopen the ticket if you are looking at an up-to-date checkout. Include the line number and file where you believe the problem is.

comment:2 by wiremine@…, 16 years ago

Resolution: invalid
Status: closedreopened

I was able to reproduce the problem this way:

  1. Part 2 of the tutorial suggests registering the model with the admin in the "Make the poll app modifiable in the admin" section.
  1. If you then import a model as described in the "Generics" documentation, you then raise a "ImproperlyConfigured" exception.

The solution is to use admin.py instead of models.py

comment:3 by Malcolm Tredinnick, 16 years ago

milestone: 1.0
Triage Stage: UnreviewedAccepted

comment:4 by James Bennett, 16 years ago

Resolution: duplicate
Status: reopenedclosed

Duplicate of #7964.

in reply to:  1 comment:5 by bb_cisze@…, 16 years ago

Has patch: set
Needs documentation: set
Needs tests: set
Resolution: duplicate
Status: closedreopened


[]

[]



Replying to mtredinnick:

I cannot see where in admin.txt we are saying to put the registration in models.py. Please reopen the ticket if you are looking at an up-to-date checkout. Include the line number and file where you believe the problem is.

comment:6 by Carl Meyer, 16 years ago

Has patch: unset
Needs documentation: unset
Needs tests: unset
Resolution: duplicate
Status: reopenedclosed

comment:7 by Jacob, 13 years ago

milestone: 1.0

Milestone 1.0 deleted

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