I’m trying to build my own custom django form widgets (putting them in widgets.py of my project directory). What should the value ‘value_from_datadict()’ return? Is it returning a string or the actual expected value of the field?
I’m building my own version of a split date/time widget using JQuery objects, what should each part of the widget return? Should the date widget return a datetime and the time widget return a datetime? What glue code merges the two values together?
For
value_from_datadict()you want to return the value you expect or None. The source in django/forms/widgets.py provides some examples.But you should be able to build a DatePicker widget by just providing a
rendermethod: