Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#6900 closed (wontfix)

Admin fails on adding empty models

Reported by: snprbob86@… Owned by: nobody
Component: contrib.admin Version: master
Severity: Keywords:
Cc: Triage Stage: Fixed on a branch
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


If you create an empty model with Admin support:

class X(models.Model):  
  class Admin:

class Y(models.Model):
  y = models.ForeignKey(X)
  class Admin:

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\ in render_change_form, line 206

Change History (2)

comment:1 Changed 8 years ago by Karen Tracey <kmtracey@…>

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to wontfix
  • Status changed from new to closed
  • Triage Stage changed from Unreviewed to Fixed on a branch

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.

comment:2 Changed 8 years ago by ubernostrum

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.
Back to Top