Allow DateTimeField to return a naive datetime
|Reported by:||Bryce Groff||Owned by:||Aymeric Augustin|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
Currently if USE_TZ = True is set in the settings file, the forms.DateTimeField will always return a timezone aware datetime. I ran into a situation where I needed to have the datetime localized by another field on the form and needed to subclass the DateTimeField to overwrite the to_python method.
Maybe we could add a kwarg naive=False that would return a naive datetime in the cleaned_data if set?
Change History (14)
comment:7 Changed 3 years ago by
|Owner:||changed from nobody to Aymeric Augustin|
|Status:||new → assigned|