formsets should be iterable
|Reported by:||kenth||Owned by:||pandres|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
I have a inlineformset where I need to be able to display some of the "extra" forms (that I initialize) before some of the "initial" forms retrieved from the db. This would be easy if I could just override formset's iter method and get the forms to come out in an order different from the creation order. This patch adds this hook.
This patch also makes it possible to say "for form in formset" (instead of "for form in formset.forms") in both code & templates. There are no backward compatibility issues.
The pattern "for form in formset" is also closer to the "for field in form" idiom.
Change History (17)
comment:1 Changed 6 years ago by kenth
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset
comment:3 Changed 6 years ago by pandres
- Resolution set to wontfix
- Status changed from new to closed
comment:4 Changed 6 years ago by russellm
- Needs documentation set
- Needs tests set
- Resolution wontfix deleted
- Status changed from closed to reopened
- Triage Stage changed from Unreviewed to Accepted
comment:12 Changed 6 years ago by russellm
- Resolution set to fixed
- Status changed from reopened to closed