From 950b6de16ac2f8135612f2ed5984c090dd8e4dcf Mon Sep 17 00:00:00 2001 From: Martin Brochhaus Date: Mon, 19 May 2014 13:23:45 +0800 Subject: Fixed #20477: Allowed settings.FORMAT_MODULE_PATH to be a list of modules. Previously the FORMAT_MODULE_PATH setting only accepted one string (dotted module path). This is useful when using several reusable third party apps that define new formats. We can now use them all and we can even override some of the formats by providing a project-wide format module. --- docs/ref/settings.txt | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'docs/ref') diff --git a/docs/ref/settings.txt b/docs/ref/settings.txt index 597e39ab99..926f0d300e 100644 --- a/docs/ref/settings.txt +++ b/docs/ref/settings.txt @@ -1378,6 +1378,20 @@ like:: __init__.py formats.py +.. versionchanged:: 1.8 + + You can also set this setting to a list of Python paths, for example:: + + FORMAT_MODULE_PATH = [ + 'mysite.formats', + 'some_app.formats', + ] + + When Django searches for a certain format, it will go through all given + Python paths until it finds a module that actually defines the given + format. This means that formats defined in packages farther up in the list + will take precedence over the same formats in packages farther down. + Available formats are :setting:`DATE_FORMAT`, :setting:`TIME_FORMAT`, :setting:`DATETIME_FORMAT`, :setting:`YEAR_MONTH_FORMAT`, :setting:`MONTH_DAY_FORMAT`, :setting:`SHORT_DATE_FORMAT`, -- cgit v1.3