From 5816a076efb16899cdeecb13846d4f97030994ef Mon Sep 17 00:00:00 2001 From: Marc Garcia Date: Tue, 4 Aug 2009 16:42:26 +0000 Subject: [soc2009/i18n] pending settings documented git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/i18n-improvements@11389 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- docs/ref/settings.txt | 101 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 101 insertions(+) diff --git a/docs/ref/settings.txt b/docs/ref/settings.txt index a5b557c5a7..cb71abec9d 100644 --- a/docs/ref/settings.txt +++ b/docs/ref/settings.txt @@ -249,6 +249,27 @@ be applied. See :ttag:`allowed date format strings `. See also ``DATETIME_FORMAT``, ``TIME_FORMAT`` and ``SHORT_DATE_FORMAT``. +.. setting:: DATE_INPUT_FORMATS + +DATE_INPUT_FORMATS +------------------ + +Default:: + + ('%Y-%m-%d', '%m/%d/%Y', '%m/%d/%y', '%b %d %Y', + '%b %d, %Y', '%d %b %Y', '%d %b, %Y', '%B %d %Y', + '%B %d, %Y', '%d %B %Y', '%d %B, %Y') + +A tuple of formats that will be accepted when inputting data on a date +field. Formats will be tried in order, using the first valid. +Note that these format strings are specified in Python's datetime_ module +syntax, that is different from the one used by Django for formatting dates +to be displayed. + +See also ``DATETIME_INPUT_FORMATS`` and ``TIME_INPUT_FORMATS``. + +.. _datetime: http://docs.python.org/library/datetime.html#strftime-behavior + .. setting:: DATETIME_FORMAT DATETIME_FORMAT @@ -262,6 +283,27 @@ be applied. See :ttag:`allowed date format strings `. See also ``DATE_FORMAT``, ``TIME_FORMAT`` and ``SHORT_DATETIME_FORMAT``. +.. setting:: DATETIME_INPUT_FORMATS + +DATETIME_INPUT_FORMATS +---------------------- + +Default:: + + ('%Y-%m-%d %H:%M:%S', '%Y-%m-%d %H:%M', '%Y-%m-%d', + '%m/%d/%Y %H:%M:%S', '%m/%d/%Y %H:%M', '%m/%d/%Y', + '%m/%d/%y %H:%M:%S', '%m/%d/%y %H:%M', '%m/%d/%y') + +A tuple of formats that will be accepted when inputting data on a datetime +field. Formats will be tried in order, using the first valid. +Note that these format strings are specified in Python's datetime_ module +syntax, that is different from the one used by Django for formatting dates +to be displayed. + +See also ``DATE_INPUT_FORMATS`` and ``TIME_INPUT_FORMATS``. + +.. _datetime: http://docs.python.org/library/datetime.html#strftime-behavior + .. setting:: DEBUG DEBUG @@ -570,6 +612,34 @@ environment variable in any HTTP request. This setting can be used to override the server-provided value of ``SCRIPT_NAME``, which may be a rewritten version of the preferred value or not supplied at all. +.. setting:: FORMAT_MODULE_PATH + +FORMAT_MODULE_PATH +------------------ + +Default: ``None`` + +A full Python path to a Python package that contains format definitions for +project locales. If not ``None``, Django will check for a ``formats.py`` +file, under the directory named as the current locale, and will use the +formats defined on this file. + +For example, if ``FORMAT_MODULE_PATH`` is set to ``mysite.formats``, and +current language is ``en`` (English), Django will expect a directory tree +like:: + + mysite/ + formats/ + __init__.py + en/ + __init__.py + formats.py + +Available formats are ``DATE_FORMAT``, ``TIME_FORMAT``, ``DATETIME_FORMAT``, +``YEAR_MONTH_FORMAT``, ``MONTH_DAY_FORMAT``, ``SHORT_DATE_FORMAT``, +``SHORT_DATETIME_FORMAT``, ``FIRST_DAY_OF_WEEK``, ``DECIMAL_SEPARATOR``, +``THOUSAND_SEPARATOR`` and ``NUMBER_GROUPING``. + .. setting:: IGNORABLE_404_ENDS IGNORABLE_404_ENDS @@ -1197,6 +1267,23 @@ be applied. See :ttag:`allowed date format strings `. See also ``DATE_FORMAT`` and ``DATETIME_FORMAT``. +.. setting:: TIME_INPUT_FORMATS + +TIME_INPUT_FORMATS +------------------ + +Default: ``('%H:%M:%S', '%H:%M')`` + +A tuple of formats that will be accepted when inputting data on a time +field. Formats will be tried in order, using the first valid. +Note that these format strings are specified in Python's datetime_ module +syntax, that is different from the one used by Django for formatting dates +to be displayed. + +See also ``DATE_INPUT_FORMATS`` and ``DATETIME_INPUT_FORMATS``. + +.. _datetime: http://docs.python.org/library/datetime.html#strftime-behavior + .. setting:: TIME_ZONE TIME_ZONE @@ -1278,6 +1365,20 @@ internationalization machinery. See also ``USE_FORMAT_I18N`` +.. setting:: USE_THOUSAND_SEPARATOR + +USE_THOUSAND_SEPARATOR +---------------------- + +Default ``False`` + +A boolean that specifies wheter to display numbers using a thousand separator. +If this is set to ``True``, Django will use values from ``THOUSAND_SEPARATOR`` +and ``NUMBER_GROUPING`` from current locale, to format the number. +``USE_FORMAT_I18N`` must be set to ``True``, in order to format numbers. + +See also ``THOUSAND_SEPARATOR`` and ``NUMBER_GROUPING``. + .. setting:: YEAR_MONTH_FORMAT YEAR_MONTH_FORMAT -- cgit v1.3