Don't show "+ Add another" in admin inlines when extra = 0
|Reported by:||rasca||Owned by:||gabrielhurley|
|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:1 Changed 6 years ago by jezdez
- Needs documentation set
- Needs tests unset
- Patch needs improvement unset
- Triage Stage changed from Unreviewed to Accepted
Changed 6 years ago by gabrielhurley
comment:2 Changed 6 years ago by gabrielhurley
- Has patch set
- Needs documentation unset
- Owner changed from nobody to gabrielhurley
- Status changed from new to assigned
- Summary changed from Don't show "+ Add another " in admin inlines to Don't show "+ Add another" in admin inlines when extra = 0
Changed 5 years ago by gabrielhurley
comment:8 Changed 5 years ago by jezdez
- Resolution set to fixed
- Status changed from assigned to closed