Opened 19 years ago
Closed 19 years ago
#3821 closed (fixed)
[patch] newforms.fields ChoiceField & MultipleChoiceField should honor widget overrides in subclasses
| Reported by: | Owned by: | Adrian Holovaty | |
|---|---|---|---|
| Component: | Forms | Version: | dev |
| Severity: | Keywords: | ||
| Cc: | Triage Stage: | Ready for checkin | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
ChoiceField & MultipleChoiceField take a default widget argument in init, and it make impossible to override widget attribute on class level in subclasses. Instead of
class MyChoiceField(ChoiceField): widget = RadioSelect .......... foo = MyChoiceField(choices=(....))
one must call it with widget argument every time:
foo = MyChoiceField(choices=(....), widget=RadioSelect)
Attachments (1)
Change History (4)
by , 19 years ago
| Attachment: | fields_choices.patch added |
|---|
comment:1 by , 19 years ago
| Component: | Uncategorized → django.newforms |
|---|---|
| Owner: | changed from to |
| Triage Stage: | Unreviewed → Ready for checkin |
comment:2 by , 19 years ago
comment:3 by , 19 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
Max, in the future please create your diffs from the root of the django repository. This makes things a bit easier for anyone trying to use the patch. Thanks.