diff options
| author | Martin Brochhaus <mbrochh@gmail.com> | 2014-05-19 13:23:45 +0800 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2014-05-21 07:35:47 -0400 |
| commit | bb0a9a070b9570c85bcb17346dae6513e4ba6e76 (patch) | |
| tree | 17c9f8c4cd129536b5cc583d5da8b82967a58521 /docs/ref | |
| parent | dfeef8e1472eadf7c3d350f6ee7328352e5953f0 (diff) | |
Fixed #20477: Allowed list of modules for FORMAT_MODULE_PATH
Previously the FORMAT_MODULE_PATH setting only accepted one string (dotted
module path). A feature has been added to also allow a list of strings.
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.
Diffstat (limited to 'docs/ref')
| -rw-r--r-- | docs/ref/settings.txt | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/docs/ref/settings.txt b/docs/ref/settings.txt index f82ced255b..acf42af7ad 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 precendence 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`, |
