Opened 12 years ago

Closed 12 years ago

#4621 closed (duplicate)

trouble on empty classes/tables in the admininterface

Reported by: bionic@… Owned by: nobody
Component: contrib.admin Version: 0.96
Severity: Keywords: checks
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


i have created on class in the app-folder:

class Foobar(models.Model):

class Admin:


if i do a python syncdb is all fine the table would be created and all is fine.

CREATE TABLE "polls_foobar" (



if i connect to the webinterface for this table and try to add try to add an entry django throws an expection:

IndexError at /admin/polls/foobar/add/
list index out of range
Request Method: GET
Request URL:
Exception Type: IndexError
Exception Value: list index out of range
Exception Location: /var/lib/python-support/python2.4/django/contrib/admin/views/ in render_change_form, line 196


Traceback (most recent call last):
File "/var/lib/python-support/python2.4/django/core/handlers/" in get_response

  1. response = callback(request, *callback_args, callback_kwargs)

File "/var/lib/python-support/python2.4/django/contrib/admin/views/" in _checklogin

  1. return view_func(request, *args, kwargs)

File "/var/lib/python-support/python2.4/django/views/decorators/" in _wrapped_view_func

  1. response = view_func(request, *args, kwargs)

File "/var/lib/python-support/python2.4/django/contrib/admin/views/" in add_stage

  1. return render_change_form(model, manipulator, c, add=True)

File "/var/lib/python-support/python2.4/django/contrib/admin/views/" in render_change_form

  1. first_form_field_id = bound_field_sets[0].bound_field_lines[0].bound_fields[0].form_fields[0].get_id();

IndexError at /admin/polls/foobar/add/
list index out of range

if i guess right that django would not check if an table is empty?

Michael Dierks

Change History (1)

comment:1 Changed 12 years ago by James Bennett

Resolution: duplicate
Status: newclosed

Feels like a duplicate of #1972.

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