diff --git a/docs/ref/settings.txt b/docs/ref/settings.txt
a
|
b
|
|
203 | 203 | DATABASES |
204 | 204 | --------- |
205 | 205 | |
206 | | .. versionadded: 1.2 |
| 206 | .. versionadded:: 1.2 |
207 | 207 | |
208 | 208 | Default: ``{}`` (Empty dictionary) |
209 | 209 | |
… |
… |
|
393 | 393 | DATABASE_ROUTERS |
394 | 394 | ---------------- |
395 | 395 | |
396 | | .. versionadded: 1.2 |
| 396 | .. versionadded:: 1.2 |
397 | 397 | |
398 | 398 | Default: ``[]`` (Empty list) |
399 | 399 | |
… |
… |
|
410 | 410 | |
411 | 411 | Default: ``'N j, Y'`` (e.g. ``Feb. 4, 2003``) |
412 | 412 | |
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>`. |
| 413 | The default formatting to use for displaying date fields in any part of the |
| 414 | system. Note that if setting:`USE_L10N` is set to ``True``, then the |
| 415 | locale-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``. |
416 | 420 | |
417 | 421 | See also ``DATETIME_FORMAT``, ``TIME_FORMAT`` and ``SHORT_DATE_FORMAT``. |
418 | 422 | |
… |
… |
|
421 | 425 | DATE_INPUT_FORMATS |
422 | 426 | ------------------ |
423 | 427 | |
| 428 | .. versionadded:: 1.2 |
| 429 | |
424 | 430 | Default:: |
425 | 431 | |
426 | 432 | ('%Y-%m-%d', '%m/%d/%Y', '%m/%d/%y', '%b %d %Y', |
… |
… |
|
444 | 450 | |
445 | 451 | Default: ``'N j, Y, P'`` (e.g. ``Feb. 4, 2003, 4 p.m.``) |
446 | 452 | |
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>`. |
| 453 | The default formatting to use for displaying datetime fields in any part of the |
| 454 | system. Note that if setting:`USE_L10N` is set to ``True``, then the |
| 455 | locale-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``. |
450 | 460 | |
451 | 461 | See also ``DATE_FORMAT``, ``TIME_FORMAT`` and ``SHORT_DATETIME_FORMAT``. |
452 | 462 | |
… |
… |
|
455 | 465 | DATETIME_INPUT_FORMATS |
456 | 466 | ---------------------- |
457 | 467 | |
| 468 | .. versionadded:: 1.2 |
| 469 | |
458 | 470 | Default:: |
459 | 471 | |
460 | 472 | ('%Y-%m-%d %H:%M:%S', '%Y-%m-%d %H:%M', '%Y-%m-%d', |
… |
… |
|
514 | 526 | DECIMAL_SEPARATOR |
515 | 527 | ----------------- |
516 | 528 | |
| 529 | .. versionadded:: 1.2 |
| 530 | |
517 | 531 | Default: ``'.'`` (Dot) |
518 | 532 | |
519 | 533 | Default decimal separator used when formatting decimal numbers. |
… |
… |
|
771 | 785 | FIRST_DAY_OF_WEEK |
772 | 786 | ----------------- |
773 | 787 | |
| 788 | .. versionadded:: 1.2 |
| 789 | |
774 | 790 | Default: ``0`` (Sunday) |
775 | 791 | |
776 | 792 | Number representing the first day of the week. This is especially useful |
… |
… |
|
807 | 823 | FORMAT_MODULE_PATH |
808 | 824 | ------------------ |
809 | 825 | |
| 826 | .. versionadded:: 1.2 |
| 827 | |
810 | 828 | Default: ``None`` |
811 | 829 | |
812 | 830 | A full Python path to a Python package that contains format definitions for |
… |
… |
|
1106 | 1124 | NUMBER_GROUPING |
1107 | 1125 | ---------------- |
1108 | 1126 | |
| 1127 | .. versionadded:: 1.2 |
| 1128 | |
1109 | 1129 | Default: ``0`` |
1110 | 1130 | |
1111 | 1131 | Number of digits grouped together on the integer part of a number. Common use |
… |
… |
|
1328 | 1348 | SHORT_DATE_FORMAT |
1329 | 1349 | ----------------- |
1330 | 1350 | |
| 1351 | .. versionadded:: 1.2 |
| 1352 | |
1331 | 1353 | Default: ``m/d/Y`` (e.g. ``12/31/2003``) |
1332 | 1354 | |
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>`. |
| 1355 | An available formatting that can be used for displaying date fields on |
| 1356 | templates. Note that if ``USE_L10N`` is set to ``True``, then the corresponding |
| 1357 | locale-dictated format has higher precedence and will be applied. See |
| 1358 | :ttag:`allowed date format strings <now>`. |
1336 | 1359 | |
1337 | 1360 | See also ``DATE_FORMAT`` and ``SHORT_DATETIME_FORMAT``. |
1338 | 1361 | |
… |
… |
|
1341 | 1364 | SHORT_DATETIME_FORMAT |
1342 | 1365 | --------------------- |
1343 | 1366 | |
| 1367 | .. versionadded:: 1.2 |
| 1368 | |
1344 | 1369 | Default: ``m/d/Y P`` (e.g. ``12/31/2003 4 p.m.``) |
1345 | 1370 | |
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>`. |
| 1371 | An available formatting that can be used for displaying datetime fields on |
| 1372 | templates. Note that if ``USE_L10N`` is set to ``True``, then the corresponding |
| 1373 | locale-dictated format has higher precedence and will be applied. See |
| 1374 | :ttag:`allowed date format strings <now>`. |
1349 | 1375 | |
1350 | 1376 | See also ``DATE_FORMAT`` and ``SHORT_DATETIME_FORMAT``. |
1351 | 1377 | |
… |
… |
|
1461 | 1487 | THOUSAND_SEPARATOR |
1462 | 1488 | ------------------ |
1463 | 1489 | |
| 1490 | .. versionadded:: 1.2 |
| 1491 | |
1464 | 1492 | Default ``,`` (Comma) |
1465 | 1493 | |
1466 | 1494 | Default thousand separator used when formatting numbers. This setting is |
… |
… |
|
1475 | 1503 | |
1476 | 1504 | Default: ``'P'`` (e.g. ``4 p.m.``) |
1477 | 1505 | |
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>`. |
| 1506 | The default formatting to use for displaying time fields in any part of the |
| 1507 | system. Note that if setting:`USE_L10N` is set to ``True``, then the |
| 1508 | locale-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``. |
1481 | 1513 | |
1482 | 1514 | See also ``DATE_FORMAT`` and ``DATETIME_FORMAT``. |
1483 | 1515 | |
… |
… |
|
1486 | 1518 | TIME_INPUT_FORMATS |
1487 | 1519 | ------------------ |
1488 | 1520 | |
| 1521 | .. versionadded:: 1.2 |
| 1522 | |
1489 | 1523 | Default: ``('%H:%M:%S', '%H:%M')`` |
1490 | 1524 | |
1491 | 1525 | A tuple of formats that will be accepted when inputting data on a time |
… |
… |
|
1556 | 1590 | USE_L10N |
1557 | 1591 | -------- |
1558 | 1592 | |
| 1593 | .. versionadded:: 1.2 |
| 1594 | |
1559 | 1595 | Default ``False`` |
1560 | 1596 | |
1561 | 1597 | A boolean that specifies if data will be localized by default or not. If this |
… |
… |
|
1583 | 1619 | USE_THOUSAND_SEPARATOR |
1584 | 1620 | ---------------------- |
1585 | 1621 | |
| 1622 | .. versionadded:: 1.2 |
| 1623 | |
1586 | 1624 | Default ``False`` |
1587 | 1625 | |
1588 | 1626 | A boolean that specifies wheter to display numbers using a thousand separator. |
diff --git a/docs/ref/templates/builtins.txt b/docs/ref/templates/builtins.txt
a
|
b
|
|
1010 | 1010 | |
1011 | 1011 | If ``value`` is ``4``, then the output will be ``6``. |
1012 | 1012 | |
1013 | | .. versionchanged:: 1.2 |
| 1013 | .. versionchanged:: 1.2 |
1014 | 1014 | The following behavior didn't exist in previous Django versions. |
1015 | 1015 | |
1016 | 1016 | This filter will first try to coerce both values to integers. If this fails, |
… |
… |
|
1026 | 1026 | output will be ``[1, 2, 3, 4, 5, 6]``. |
1027 | 1027 | |
1028 | 1028 | .. warning:: |
1029 | | |
| 1029 | |
1030 | 1030 | Keep in mind that strings that can both be coerced to integers will be, |
1031 | 1031 | and thus will be will be *summed*, not concatenated, as in the first |
1032 | 1032 | example above. |
… |
… |
|
1103 | 1103 | ``datetime.datetime.now()``), the output will be the string |
1104 | 1104 | ``'Wed 09 Jan 2008'``. |
1105 | 1105 | |
| 1106 | Another example: |
| 1107 | |
| 1108 | Assuming that :setting:`USE_L10N` is ``True`` and :setting:`LANGUAGE_CODE` is, |
| 1109 | for example, ``"es"``, then for:: |
| 1110 | |
| 1111 | {{ value|date:"SHORT_DATE_FORMAT" }} |
| 1112 | |
| 1113 | the output will be the string ``"09/01/2008"`` (The ``"SHORT_DATE_FORMAT"`` |
| 1114 | format specifier for the ``es`` locale as shipped with Django is ``"d/m/Y"``). |
| 1115 | |
1106 | 1116 | When used without a format string:: |
1107 | 1117 | |
1108 | 1118 | {{ value|date }} |
… |
… |
|
1110 | 1120 | ...the formatting string defined in the :setting:`DATE_FORMAT` setting will be |
1111 | 1121 | used, without applying any localization. |
1112 | 1122 | |
| 1123 | .. versionchanged:: 1.2 |
| 1124 | Predefined formats can now be influenced by the current locale. |
| 1125 | |
1113 | 1126 | .. templatefilter:: default |
1114 | 1127 | |
1115 | 1128 | default |
… |
… |
|
1730 | 1743 | If ``value`` is equivalent to ``datetime.datetime.now()``, the output will be |
1731 | 1744 | the string ``"01:23"``. |
1732 | 1745 | |
| 1746 | Another example: |
| 1747 | |
| 1748 | Assuming that :setting:`USE_L10N` is ``True`` and :setting:`LANGUAGE_CODE` is, |
| 1749 | for example, ``"de"``, then for:: |
| 1750 | |
| 1751 | {{ value|time:"TIME_FORMAT" }} |
| 1752 | |
| 1753 | the output will be the string ``"01:23:00"`` (The ``"TIME_FORMAT"`` format |
| 1754 | specifier for the ``de`` locale as shipped with Django is ``"H:i:s"``). |
| 1755 | |
1733 | 1756 | When used without a format string:: |
1734 | 1757 | |
1735 | 1758 | {{ value|time }} |
1736 | 1759 | |
1737 | 1760 | ...the formatting string defined in the :setting:`TIME_FORMAT` setting will be |
1738 | | used, without aplying any localization. |
| 1761 | used, without applying any localization. |
| 1762 | |
| 1763 | .. versionchanged:: 1.2 |
| 1764 | Predefined formats can now be influenced by the current locale. |
1739 | 1765 | |
1740 | 1766 | .. templatefilter:: timesince |
1741 | 1767 | |
diff --git a/docs/topics/i18n/localization.txt b/docs/topics/i18n/localization.txt
a
|
b
|
|
247 | 247 | Format localization |
248 | 248 | =================== |
249 | 249 | |
| 250 | .. versionadded:: 1.2 |
| 251 | |
250 | 252 | Django's formatting system is disabled by default. To enable it, it's necessary |
251 | 253 | to set :setting:`USE_L10N = True <USE_L10N>` in your settings file. |
252 | 254 | |