Code

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#10281 closed (fixed)

generic inline formsets don't allow custom prefix

Reported by: akaihola Owned by: brosner
Component: Contrib apps Version: master
Severity: Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

Generic inline formset classes created with generic_inlineformset_factory() don't accept the prefix= keyword argument. They constructs the prefix from the app, model and generic relation field names instead.

The inability to override the prefix is not consistent with other form and formset classes, which all do accept the prefix= kwarg.

Attachments (1)

10281-generic-inline-formset-prefix.diff (2.3 KB) - added by akaihola 5 years ago.
Patch adds the prefix= kwarg to generic inline formsets. Includes a new test.

Download all attachments as: .zip

Change History (5)

Changed 5 years ago by akaihola

Patch adds the prefix= kwarg to generic inline formsets. Includes a new test.

comment:1 Changed 5 years ago by Alex

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

FWIW this was added in the patch on #10271 as well, as it was necessary to write the actual patch :)

comment:2 Changed 5 years ago by Alex

  • Has patch set
  • Triage Stage changed from Unreviewed to Accepted

comment:3 Changed 5 years ago by russellm

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

(In [10017]) Fixed #10271, #10281 -- Fixed the handling multiple inline models that share a common base class and have the link to the inline parent on the base class. Includes modifications that allow the equivalent handling for GenericFields. Thanks to Idan Gazit, Antti Kaihola (akaihola), and Alex Gaynor for their work on this patch.

comment:4 Changed 5 years ago by russellm

(In [10019]) [1.0.X] Fixed #10271, #10281 -- Fixed the handling multiple inline models that share a common base class and have the link to the inline parent on the base class. Includes modifications that allow the equivalent handling for GenericFields. Thanks to Idan Gazit, Antti Kaihola (akaihola), and Alex Gaynor for their work on this patch.

Backport of r10017 from trunk.

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.