Opened 17 years ago
Closed 17 years ago
#9171 closed (fixed)
must pass `list` not `tuple` as `exclude` (as seen in docs) to `inlineformset_factory`.
| Reported by: | Tai Lee | Owned by: | nobody |
|---|---|---|---|
| Component: | Forms | Version: | dev |
| Severity: | Keywords: | inlineformset_factory exclude | |
| Cc: | Triage Stage: | Accepted | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
If the exclude argument is not None but is also not list an exception will be raised as we try to append the foreign key field. Patch simply calls list() on exclude to allow any iterable to be passed in, similar to ChoiceField._set_choices.
Attachments (2)
Change History (4)
by , 17 years ago
| Attachment: | 9171-inlineformset_factory-r9082.diff added |
|---|
comment:1 by , 17 years ago
| Triage Stage: | Unreviewed → Accepted |
|---|
by , 17 years ago
| Attachment: | 9171-inlineformset_factory-r9082.2.diff added |
|---|
Also fix ModelAdmin and InlineModelAdmin to allow a tuple for exclude.
comment:2 by , 17 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
Added regression test that fails before and passes after patch is applied.