Opened 18 years ago
Closed 18 years ago
#5728 closed (duplicate)
SelectDateWidget does not work with datetime.date
| Reported by: | MikeH | Owned by: | nobody |
|---|---|---|---|
| Component: | Forms | Version: | dev |
| Severity: | Keywords: | SelectDateWidget | |
| Cc: | Triage Stage: | Unreviewed | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
If I'm creating a form to update an existing object, I pass in the date from the object. This is a datetime.date but the SelectDateWidget in newforms.extras.widgets expects it to be a string, or else it does not set the values on the select boxes correctly.
I solved the problem by forcing the incoming value to be a string.
Add
value = str(value)
at line 33 of django/newforms/extras/widgets.py (using revision 6468)
Note:
See TracTickets
for help on using tickets.
Duplicated by #5917, which has patches.