custom FORMAT_SETTINGS

13 views
Skip to first unread message

Erik Stein

unread,
Mar 18, 2016, 8:31:45 AM3/18/16
to django...@googlegroups.com

hello --

I'd like to extend Django's localized formats by my own defaults, using
the FORMAT_MODULE_PATH setting, e.g. to have those:

SHORT_DAY_ONLY_FORMAT = 'd.'
SHORT_DAYMONTH_FORMAT = 'd.N.'
DATE_RANGE_SEPARATOR = '–'

Sadly, in django.utils.formats.get_format Django checks the hard coded
list of possible FORMAT_SETTINGS and returns the placeholder string if
it doesn't know the format.

Do I missing something or is it just not possible currently to extend
the default formats?

best
-- erik

Erik Stein

unread,
Mar 18, 2016, 2:26:46 PM3/18/16
to django...@googlegroups.com

Nevermind, I reused the locale-directory for the format-definitions and
didn't realize, that the path has to be a python module (or: didn't
realize, that the locale directory isn't a module by default).

best
-- erik
Reply all
Reply to author
Forward
0 new messages