#1605 closed defect (fixed)
DateTime fields not being populated back
| Reported by: | yml | Owned by: | Adrian Holovaty |
|---|---|---|---|
| Component: | Core (Other) | Version: | 0.91 |
| Severity: | normal | Keywords: | |
| Cc: | Triage Stage: | Unreviewed | |
| Has patch: | no | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
There's a problem with DateTime fields not being populated back to the form using the edit_place function.
This seems to provide the solution:
In place of:
new_data = place.dict
use:
new_data = manipulator.flatten_data()
Note:
See TracTickets
for help on using tickets.
The current forms & manipulators documentation says to use place.dict, but the admin and crud generic view both use flaten_data(). Is this a documentation bug?
A similar situation exists for file fields - to upload successfully, you must add request.FILES to new_data; but this is not mentioned in the forms and manipulators documentation.