Opened 17 years ago

Closed 16 years ago

#5759 closed (fixed)

[newforms-admin] inline_formset() doesn't allow customized forms

Reported by: Antti Kaihola Owned by: nobody
Component: Forms Version: newforms-admin
Severity: Keywords: nfa-blocker
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: yes
Easy pickings: no UI/UX: no

Description

As described in the documentation, the form_for_model() and form_for_instance() functions accept a form= keyword argument for specifying a custom form as their base classes.

In the newforms-admin branch, the formset_for_model() function supports a similar form= keyword argument, but the inline_formset() function does not. It would be useful to have this functionality.

Attachments (2)

inline_formset_form_kwarg.diff (1.2 KB ) - added by Antti Kaihola 17 years ago.
simple patch to provide this functionality
5759-inline_formset_extra_kwargs.diff (1.9 KB ) - added by Antti Kaihola 17 years ago.
added the formset= kwarg, changed kwarg order

Download all attachments as: .zip

Change History (8)

by Antti Kaihola, 17 years ago

simple patch to provide this functionality

comment:1 by Antti Kaihola, 17 years ago

Actually it would be useful to have the formset= keyword argument as well, i.e. to be able to view only a subset of the related objects.

by Antti Kaihola, 17 years ago

added the formset= kwarg, changed kwarg order

comment:2 by Antti Kaihola, 17 years ago

In the second patch I added the formset= kwarg and reordered keyword arguments in both inline_formset() and formset_for_model() to match those of functions further down the call stack. Might reduce confusion if someone wants to omit keywords and provide values as positional arguments.

comment:3 by Brian Rosner, 17 years ago

Patch needs improvement: set
Triage Stage: UnreviewedDesign decision needed

This is generally a good idea, however, inline formsets will be changing before newforms-admin is considered complete. Will mark as DDN to see if this will be needed after some refactoring.

comment:4 by Brian Rosner, 17 years ago

Triage Stage: Design decision neededAccepted

Ok, now since formset_for_queryset is in newforms-admin (r6655) this is now a very good idea.

comment:5 by Brian Rosner, 16 years ago

Keywords: nfa-blocker added

I firmly believe this needs to be included before a merge to trunk. It is actually blocking my ability to write a good patch for #5721. Tagging with nfa-blocker.

comment:6 by mrts, 16 years ago

Resolution: fixed
Status: newclosed

This has been fixed with the new form class field in admin classes. Tested with StackedInline, works correctly.

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