Now settings like **DATE_FORMAT**, **DATETIME_FORMAT**,
**DATE_FORMAT_INPUTS** etc.. don't work because as per documentation:
"Note that the locale-dictated format has higher precedence and will be
applied instead. But now locale-dictated formats are always enabled."
Now locale-dictated formats will always have higher precedence.
It alse breaks editing on all ModelForms which have date and datetime
fields because the input is expecting ISO format, but Django forcefully
localizes the value attribute to another format.
I've found a solution but overriding the formats.py file using the
**FORMAT_MODULE_PATH** setting. I think at least the documents should make
it clear you can do that.
--
Ticket URL: <https://code.djangoproject.com/ticket/35142>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* status: new => closed
* resolution: => needsinfo
* component: Uncategorized => Internationalization
* type: Bug => Cleanup/optimization
Comment:
> It alse breaks editing on all ModelForms which have date and datetime
fields because the input is expecting ISO format, but Django forcefully
localizes the value attribute to another format.
I don't think that it's true, can you provide a sample project that
reproduces your issue.
> I've found a solution but overriding the formats.py file using the
FORMAT_MODULE_PATH setting. I think at least the documents should make it
clear you can do that.
True, if you don't like formats provided for a language you're working
with, you can use `FORMAT_MODULE_PATH` to specify your own format
definitions. This setting is documented, I'm not sure what else are you
trying to propose.
--
Ticket URL: <https://code.djangoproject.com/ticket/35142#comment:1>
> I don't think that it's true, can you provide a sample project that
reproduces your issue.
I've created a demo project at https://github.com/paulik123/django-demo-
l10n
Just create a demo object then click edit.
> True, if you don't like formats provided for a language you're working
with, you can use FORMAT_MODULE_PATH to specify your own format
definitions. This setting is documented, I'm not sure what else are you
trying to propose.
Yes, but not specifying that all format settings (DATE_FORMAT,
DATETIME_FORMAT etc) won't work if you just paste them settings.py seems
confusing to me. I think at least a note should be added saying that to
modify these settings you need to override formats.py
Replying to [comment:1 Mariusz Felisiak]:
--
Ticket URL: <https://code.djangoproject.com/ticket/35142#comment:2>
Old description:
> Since 5.0 **USE_L10N** settings was DEPRECATED and is always True.
>
> Now settings like **DATE_FORMAT**, **DATETIME_FORMAT**,
> **DATE_FORMAT_INPUTS** etc.. don't work because as per documentation:
> "Note that the locale-dictated format has higher precedence and will be
> applied instead. But now locale-dictated formats are always enabled."
> Now locale-dictated formats will always have higher precedence.
>
> It alse breaks editing on all ModelForms which have date and datetime
> fields because the input is expecting ISO format, but Django forcefully
> localizes the value attribute to another format.
>
> I've found a solution but overriding the formats.py file using the
> **FORMAT_MODULE_PATH** setting. I think at least the documents should
> make it clear you can do that.
New description:
Since 5.0 **USE_L10N** settings was DEPRECATED and is always True.
Now settings like **DATE_FORMAT**, **DATETIME_FORMAT**,
**DATE_FORMAT_INPUTS** etc.. don't work because as per documentation:
"Note that the locale-dictated format has higher precedence and will be
applied instead. But now locale-dictated formats are always enabled."
Now locale-dictated formats will always have higher precedence.
It alse breaks editing on all ModelForms which have date and datetime
fields because the input is expecting ISO format, but Django forcefully
localizes the value attribute to another format.
I've found a solution but overriding the formats.py file using the
**FORMAT_MODULE_PATH** setting. I think at least the documents should make
it clear you can do that.
DEMO PROJECT: https://github.com/paulik123/django-demo-l10n
--
--
Ticket URL: <https://code.djangoproject.com/ticket/35142#comment:3>