Code

Opened 3 years ago

Closed 3 years ago

#16582 closed Bug (invalid)

InlineModelAdmin subclass does not respect the 'extra' field

Reported by: peter2108 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},
    }

Attachments (0)

Change History (2)

comment:1 Changed 3 years ago by peter2108

  • Cc peter@… added
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

comment:2 Changed 3 years ago by peter2108

  • Resolution set to invalid
  • Status changed from new to closed

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.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.