Don't show "+ Add another" in admin inlines when extra = 0
|Reported by:||rasca||Owned by:||Gabriel Hurley|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
Up to 1.1 when dealing with inlines in the admin one could set extra=0 to prevent a user to add a new related model.
With the new dynamic inlines, this can't be prevented.
I'm not sure if this is a Bug or not, but certainly we've lost a functionality we had in 1.1, and the code works differently
The 'extra' doc says:
"This controls the number of extra forms the formset will display in addition to the initial forms."
It isn't clear if extra refers to the amount of extra inlines in the initial display or the extra amount of dynamic additions permitted.
I support the first alternative, so we don't to have to change our code, and it maintains the same usability with or without js.
I have models A and B. Model B has a fk to model A, and it's shown as inline in the A's change_form.
Model B is too complex to be created in an inline (or has inline's itself).
For usability's sake I often show B as inlines in A, so the user can see the list of B while editing A and allow them to delete a certain B from A (I only show a few readonly fields of B).
Another use is to allow easy drag and drop ordering for a set of B.
Change History (18)
comment:2 Changed 7 years ago by
|Owner:||changed from nobody to Gabriel Hurley|
|Status:||new → assigned|
|Summary:||Don't show "+ Add another " in admin inlines → Don't show "+ Add another" in admin inlines when extra = 0|