#6900 closed (wontfix)
Admin fails on adding empty models
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | contrib.admin | Version: | dev |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Fixed on a branch | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
If you create an empty model with Admin support:
class X(models.Model): class Admin: pass class Y(models.Model): y = models.ForeignKey(X) class Admin: pass
Then try to add an X in the admin interface, you get this error:
Exception Type: IndexError Exception Value: list index out of range Exception Location: C:\Program Files\Python25\lib\site-packages\django\contrib\admin\views\main.py in render_change_form, line 206
Change History (2)
comment:1 by , 17 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
Triage Stage: | Unreviewed → Fixed on a branch |
comment:2 by , 17 years ago
Also, "empty models don't work in the admin" has been reported many times, and wontfixed on the grounds that there's nothing to administer there so it wouldn't matter anyway, and in other contexts can be more efficiently emulated by, say, a sequence in the database (since an empty model basically turns into a table with a single, autoincrementing column).
Note:
See TracTickets
for help on using tickets.
I tried this on newforms-admin and there is no error with the new admin. No effort is going into old admin so I don't think this will be fixed in the current trunk admin.