Opened 13 years ago

Closed 13 years ago

#16582 closed Bug (invalid)

InlineModelAdmin subclass does not respect the 'extra' field

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

Description

Upgrading from Django 1.x to Django 1.3 I needed to change the class below setting extra=0 in order to obtain 1 extra field. When extra was 1 then 2 extra fields were shown, when extra was 3 then 4 extra fields were shown etc. The max_num was respected.

class MyInlineModelAdmin(InlineModelAdmin):           
    template = "admin/projects/project/tabular.html"
    extra = 1  # shows 2 extra fields
    max_num = 6
    formfield_overrides = {
        models.ImageField: {'widget': ThumbnailWidget},
    }

Change History (2)

comment:1 by Peter Mott, 13 years ago

Cc: peter@… added

comment:2 by Peter Mott, 13 years ago

Resolution: invalid
Status: newclosed

The error occured because of my use of a custom tabular.html The issue was fixed when I used the tabular.html with the distribution.

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