Opened 17 years ago
Closed 17 years ago
#3401 closed (duplicate)
[patch] newforms: models.CharField with choices should be displayed as forms.ChoiceField according to oldforms behavior
Reported by: | Owned by: | Adrian Holovaty | |
---|---|---|---|
Component: | Forms | Version: | dev |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Unreviewed | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Hello Adrian
With oldforms any model.CharField(..., choices=(...)) is displayed as <select ...> ...choices...</select>
In newforms this feature seem to be unimplemented yet and model.CharField is always displayed as forms.CharField. This behavior is unexpected. Attached patch fixes this.
Attachments (1)
Change History (4)
Changed 17 years ago by
Attachment: | char_field_with_choices.patch added |
---|
comment:1 Changed 17 years ago by
P.S. I DO know that it can be also done manually through callback function to form_to_model/form_to_instance calls, but it seems to be not right in this situation because if I always need to specify callback_func, there's no reason to me to specify choices=() in the model.
comment:3 Changed 17 years ago by
Resolution: | → duplicate |
---|---|
Status: | new → closed |
marking a duplicate of #3268 and have made a note there about the patch attached here.
patch that fixes the issue