Ticket #12967: 12967.2.diff

File 12967.2.diff, 8.2 KB (added by Ramiro Morales, 14 years ago)
  • docs/ref/settings.txt

    diff --git a/docs/ref/settings.txt b/docs/ref/settings.txt
    a b  
    203203DATABASES
    204204---------
    205205
    206 .. versionadded: 1.2
     206.. versionadded:: 1.2
    207207
    208208Default: ``{}`` (Empty dictionary)
    209209
     
    393393DATABASE_ROUTERS
    394394----------------
    395395
    396 .. versionadded: 1.2
     396.. versionadded:: 1.2
    397397
    398398Default: ``[]`` (Empty list)
    399399
     
    410410
    411411Default: ``'N j, Y'`` (e.g. ``Feb. 4, 2003``)
    412412
    413 The default formatting to use for date fields in any part of the system.
    414 Note that if ``USE_L10N`` is set to ``True``, then locale format will
    415 be applied. See :ttag:`allowed date format strings <now>`.
     413The default formatting to use for displaying date fields in any part of the
     414system.  Note that if setting:`USE_L10N` is set to ``True``, then the
     415locale-dictated format has higher precedence and will be applied instead. See
     416:ttag:`allowed date format strings <now>`.
     417
     418.. versionchanged:: 1.2
     419    This setting can now be overriden by setting ``USE_L10N`` to ``True``.
    416420
    417421See also ``DATETIME_FORMAT``, ``TIME_FORMAT`` and ``SHORT_DATE_FORMAT``.
    418422
     
    421425DATE_INPUT_FORMATS
    422426------------------
    423427
     428.. versionadded:: 1.2
     429
    424430Default::
    425431
    426432    ('%Y-%m-%d', '%m/%d/%Y', '%m/%d/%y', '%b %d %Y',
     
    444450
    445451Default: ``'N j, Y, P'`` (e.g. ``Feb. 4, 2003, 4 p.m.``)
    446452
    447 The default formatting to use for datetime fields in any part of the system.
    448 Note that if ``USE_L10N`` is set to ``True``, then locale format will
    449 be applied. See :ttag:`allowed date format strings <now>`.
     453The default formatting to use for displaying datetime fields in any part of the
     454system.  Note that if setting:`USE_L10N` is set to ``True``, then the
     455locale-dictated format has higher precedence and will be applied instead. See
     456:ttag:`allowed date format strings <now>`.
     457
     458.. versionchanged:: 1.2
     459    This setting can now be overriden by setting ``USE_L10N`` to ``True``.
    450460
    451461See also ``DATE_FORMAT``, ``TIME_FORMAT`` and ``SHORT_DATETIME_FORMAT``.
    452462
     
    455465DATETIME_INPUT_FORMATS
    456466----------------------
    457467
     468.. versionadded:: 1.2
     469
    458470Default::
    459471
    460472    ('%Y-%m-%d %H:%M:%S', '%Y-%m-%d %H:%M', '%Y-%m-%d',
     
    514526DECIMAL_SEPARATOR
    515527-----------------
    516528
     529.. versionadded:: 1.2
     530
    517531Default: ``'.'`` (Dot)
    518532
    519533Default decimal separator used when formatting decimal numbers.
     
    771785FIRST_DAY_OF_WEEK
    772786-----------------
    773787
     788.. versionadded:: 1.2
     789
    774790Default: ``0`` (Sunday)
    775791
    776792Number representing the first day of the week. This is especially useful
     
    807823FORMAT_MODULE_PATH
    808824------------------
    809825
     826.. versionadded:: 1.2
     827
    810828Default: ``None``
    811829
    812830A full Python path to a Python package that contains format definitions for
     
    11061124NUMBER_GROUPING
    11071125----------------
    11081126
     1127.. versionadded:: 1.2
     1128
    11091129Default: ``0``
    11101130
    11111131Number of digits grouped together on the integer part of a number. Common use
     
    13281348SHORT_DATE_FORMAT
    13291349-----------------
    13301350
     1351.. versionadded:: 1.2
     1352
    13311353Default: ``m/d/Y`` (e.g. ``12/31/2003``)
    13321354
    1333 An available formatting that can be used for date fields on templates.
    1334 Note that if ``USE_L10N`` is set to ``True``, then locale format will
    1335 be applied. See :ttag:`allowed date format strings <now>`.
     1355An available formatting that can be used for displaying date fields on
     1356templates.  Note that if ``USE_L10N`` is set to ``True``, then the corresponding
     1357locale-dictated format has higher precedence and will be applied. See
     1358:ttag:`allowed date format strings <now>`.
    13361359
    13371360See also ``DATE_FORMAT`` and ``SHORT_DATETIME_FORMAT``.
    13381361
     
    13411364SHORT_DATETIME_FORMAT
    13421365---------------------
    13431366
     1367.. versionadded:: 1.2
     1368
    13441369Default: ``m/d/Y P`` (e.g. ``12/31/2003 4 p.m.``)
    13451370
    1346 An available formatting that can be used for datetime fields on templates.
    1347 Note that if ``USE_L10N`` is set to ``True``, then locale format will
    1348 be applied. See :ttag:`allowed date format strings <now>`.
     1371An available formatting that can be used for displaying datetime fields on
     1372templates.  Note that if ``USE_L10N`` is set to ``True``, then the corresponding
     1373locale-dictated format has higher precedence and will be applied. See
     1374:ttag:`allowed date format strings <now>`.
    13491375
    13501376See also ``DATE_FORMAT`` and ``SHORT_DATETIME_FORMAT``.
    13511377
     
    14611487THOUSAND_SEPARATOR
    14621488------------------
    14631489
     1490.. versionadded:: 1.2
     1491
    14641492Default ``,`` (Comma)
    14651493
    14661494Default thousand separator used when formatting numbers. This setting is
     
    14751503
    14761504Default: ``'P'`` (e.g. ``4 p.m.``)
    14771505
    1478 The default formatting to use for time fields in any part of the system.
    1479 Note that if ``USE_L10N`` is set to ``True``, then locale format will
    1480 be applied. See :ttag:`allowed date format strings <now>`.
     1506The default formatting to use for displaying time fields in any part of the
     1507system.  Note that if setting:`USE_L10N` is set to ``True``, then the
     1508locale-dictated format has higher precedence and will be applied instead. See
     1509:ttag:`allowed date format strings <now>`.
     1510
     1511.. versionchanged:: 1.2
     1512    This setting can now be overriden by setting ``USE_L10N`` to ``True``.
    14811513
    14821514See also ``DATE_FORMAT`` and ``DATETIME_FORMAT``.
    14831515
     
    14861518TIME_INPUT_FORMATS
    14871519------------------
    14881520
     1521.. versionadded:: 1.2
     1522
    14891523Default: ``('%H:%M:%S', '%H:%M')``
    14901524
    14911525A tuple of formats that will be accepted when inputting data on a time
     
    15561590USE_L10N
    15571591--------
    15581592
     1593.. versionadded:: 1.2
     1594
    15591595Default ``False``
    15601596
    15611597A boolean that specifies if data will be localized by default or not. If this
     
    15831619USE_THOUSAND_SEPARATOR
    15841620----------------------
    15851621
     1622.. versionadded:: 1.2
     1623
    15861624Default ``False``
    15871625
    15881626A boolean that specifies wheter to display numbers using a thousand separator.
  • docs/ref/templates/builtins.txt

    diff --git a/docs/ref/templates/builtins.txt b/docs/ref/templates/builtins.txt
    a b  
    10101010
    10111011If ``value`` is ``4``, then the output will be ``6``.
    10121012
    1013 .. versionchanged:: 1.2 
     1013.. versionchanged:: 1.2
    10141014   The following behavior didn't exist in previous Django versions.
    10151015
    10161016This filter will first try to coerce both values to integers. If this fails,
     
    10261026output will be ``[1, 2, 3, 4, 5, 6]``.
    10271027
    10281028.. warning::
    1029    
     1029
    10301030    Keep in mind that strings that can both be coerced to integers will be,
    10311031    and thus will be will be *summed*, not concatenated, as in the first
    10321032    example above.
     
    11031103``datetime.datetime.now()``), the output will be the string
    11041104``'Wed 09 Jan 2008'``.
    11051105
     1106Another example:
     1107
     1108Assuming that :setting:`USE_L10N` is ``True`` and :setting:`LANGUAGE_CODE` is,
     1109for example, ``"es"``, then for::
     1110
     1111    {{ value|date:"SHORT_DATE_FORMAT" }}
     1112
     1113the output will be the string ``"09/01/2008"`` (The ``"SHORT_DATE_FORMAT"``
     1114format specifier for the ``es`` locale as shipped with Django is ``"d/m/Y"``).
     1115
    11061116When used without a format string::
    11071117
    11081118    {{ value|date }}
     
    11101120...the formatting string defined in the :setting:`DATE_FORMAT` setting will be
    11111121used, without applying any localization.
    11121122
     1123.. versionchanged:: 1.2
     1124    Predefined formats can now be influenced by the current locale.
     1125
    11131126.. templatefilter:: default
    11141127
    11151128default
     
    17301743If ``value`` is equivalent to ``datetime.datetime.now()``, the output will be
    17311744the string ``"01:23"``.
    17321745
     1746Another example:
     1747
     1748Assuming that :setting:`USE_L10N` is ``True`` and :setting:`LANGUAGE_CODE` is,
     1749for example, ``"de"``, then for::
     1750
     1751    {{ value|time:"TIME_FORMAT" }}
     1752
     1753the output will be the string ``"01:23:00"`` (The ``"TIME_FORMAT"`` format
     1754specifier for the ``de`` locale as shipped with Django is ``"H:i:s"``).
     1755
    17331756When used without a format string::
    17341757
    17351758    {{ value|time }}
    17361759
    17371760...the formatting string defined in the :setting:`TIME_FORMAT` setting will be
    1738 used, without aplying any localization.
     1761used, without applying any localization.
     1762
     1763.. versionchanged:: 1.2
     1764    Predefined formats can now be influenced by the current locale.
    17391765
    17401766.. templatefilter:: timesince
    17411767
  • docs/topics/i18n/localization.txt

    diff --git a/docs/topics/i18n/localization.txt b/docs/topics/i18n/localization.txt
    a b  
    247247Format localization
    248248===================
    249249
     250.. versionadded:: 1.2
     251
    250252Django's formatting system is disabled by default. To enable it, it's necessary
    251253to set :setting:`USE_L10N = True <USE_L10N>` in your settings file.
    252254
Back to Top