Hi Carlton,

I don't understand how this is related to Custom Format Files.

I want to be able to define settings, such as YEAR_FORMAT which I defined
in Speedy Net, where I would define a default value (such as 'Y') which can
be overridden for some specific locales. If it's not overridden, the value
will come from the global setting, which I define in the settings file of
the project. This will expand the list defined in
https://github.com/django/django/blob/master/django/utils/formats.py#L31-L46
('DATE_FORMAT', 'TIME_FORMAT' and so on).
אורי
u...@speedy.net


On Mon, Dec 2, 2019 at 4:03 PM Carlton Gibson <carlton.gib...@gmail.com>
wrote:

> Hi Uri.
>
> Can you explain (I couldn't exactly follow from the ticket/commit/SO post)
> why Custom Format Files[0]
> are not the way to go for you here?
>
> [0]
> https://docs.djangoproject.com/en/2.2/topics/i18n/formatting/#creating-custom-format-files
>
> Thanks.
> Carlton
>
> On Monday, 2 December 2019 05:32:53 UTC+1, Uri wrote:
>>
>> Django developers,
>>
>> I just added this feature request:
>> https://code.djangoproject.com/ticket/31052
>>
>> I customized FORMAT_SETTINGS in Speedy Net, you can see more information
>> in this commit:
>>
>> https://github.com/speedy-net/speedy-net/commit/f5dc4896c136a816ab9fe0dc360d3fd59d0a5f33
>>
>>
>> And on Stack Overflow:
>>
>> https://stackoverflow.com/questions/57188435/django-how-do-i-override-default-date-formats-per-locale
>>
>> To customize FORMAT_SETTINGS I had to patch 14 files, because the tests
>> failed and I had to patch the tests too. Is it possible to let Django users
>> customize FORMAT_SETTINGS without having to patch files? For example you
>> can check if the settings contain FORMAT_SETTINGS, and if it is - include
>> these settings in the global FORMAT_SETTINGS (a union, like in the above
>> commit).
>>
>> formats.FORMAT_SETTINGS =
>> formats.FORMAT_SETTINGS.union(django_settings.FORMAT_SETTINGS)
>>
>> אורי
>> u...@speedy.net
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django developers (Contributions to Django itself)" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-developers+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-developers/22755ead-1fe0-460a-9581-41c920f4e424%40googlegroups.com
> <https://groups.google.com/d/msgid/django-developers/22755ead-1fe0-460a-9581-41c920f4e424%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CABD5YeF537ooATZE_eBootJL6ZEZri0TGgxH4xYRRy0T1zUtJA%40mail.gmail.com.

Reply via email to