Code

Ticket #12967: 12967.2.diff

File 12967.2.diff, 8.2 KB (added by ramiro, 4 years ago)
Line 
1diff --git a/docs/ref/settings.txt b/docs/ref/settings.txt
2--- a/docs/ref/settings.txt
3+++ b/docs/ref/settings.txt
4@@ -203,7 +203,7 @@
5 DATABASES
6 ---------
7 
8-.. versionadded: 1.2
9+.. versionadded:: 1.2
10 
11 Default: ``{}`` (Empty dictionary)
12 
13@@ -393,7 +393,7 @@
14 DATABASE_ROUTERS
15 ----------------
16 
17-.. versionadded: 1.2
18+.. versionadded:: 1.2
19 
20 Default: ``[]`` (Empty list)
21 
22@@ -410,9 +410,13 @@
23 
24 Default: ``'N j, Y'`` (e.g. ``Feb. 4, 2003``)
25 
26-The default formatting to use for date fields in any part of the system.
27-Note that if ``USE_L10N`` is set to ``True``, then locale format will
28-be applied. See :ttag:`allowed date format strings <now>`.
29+The default formatting to use for displaying date fields in any part of the
30+system.  Note that if setting:`USE_L10N` is set to ``True``, then the
31+locale-dictated format has higher precedence and will be applied instead. See
32+:ttag:`allowed date format strings <now>`.
33+
34+.. versionchanged:: 1.2
35+    This setting can now be overriden by setting ``USE_L10N`` to ``True``.
36 
37 See also ``DATETIME_FORMAT``, ``TIME_FORMAT`` and ``SHORT_DATE_FORMAT``.
38 
39@@ -421,6 +425,8 @@
40 DATE_INPUT_FORMATS
41 ------------------
42 
43+.. versionadded:: 1.2
44+
45 Default::
46 
47     ('%Y-%m-%d', '%m/%d/%Y', '%m/%d/%y', '%b %d %Y',
48@@ -444,9 +450,13 @@
49 
50 Default: ``'N j, Y, P'`` (e.g. ``Feb. 4, 2003, 4 p.m.``)
51 
52-The default formatting to use for datetime fields in any part of the system.
53-Note that if ``USE_L10N`` is set to ``True``, then locale format will
54-be applied. See :ttag:`allowed date format strings <now>`.
55+The default formatting to use for displaying datetime fields in any part of the
56+system.  Note that if setting:`USE_L10N` is set to ``True``, then the
57+locale-dictated format has higher precedence and will be applied instead. See
58+:ttag:`allowed date format strings <now>`.
59+
60+.. versionchanged:: 1.2
61+    This setting can now be overriden by setting ``USE_L10N`` to ``True``.
62 
63 See also ``DATE_FORMAT``, ``TIME_FORMAT`` and ``SHORT_DATETIME_FORMAT``.
64 
65@@ -455,6 +465,8 @@
66 DATETIME_INPUT_FORMATS
67 ----------------------
68 
69+.. versionadded:: 1.2
70+
71 Default::
72 
73     ('%Y-%m-%d %H:%M:%S', '%Y-%m-%d %H:%M', '%Y-%m-%d',
74@@ -514,6 +526,8 @@
75 DECIMAL_SEPARATOR
76 -----------------
77 
78+.. versionadded:: 1.2
79+
80 Default: ``'.'`` (Dot)
81 
82 Default decimal separator used when formatting decimal numbers.
83@@ -771,6 +785,8 @@
84 FIRST_DAY_OF_WEEK
85 -----------------
86 
87+.. versionadded:: 1.2
88+
89 Default: ``0`` (Sunday)
90 
91 Number representing the first day of the week. This is especially useful
92@@ -807,6 +823,8 @@
93 FORMAT_MODULE_PATH
94 ------------------
95 
96+.. versionadded:: 1.2
97+
98 Default: ``None``
99 
100 A full Python path to a Python package that contains format definitions for
101@@ -1106,6 +1124,8 @@
102 NUMBER_GROUPING
103 ----------------
104 
105+.. versionadded:: 1.2
106+
107 Default: ``0``
108 
109 Number of digits grouped together on the integer part of a number. Common use
110@@ -1328,11 +1348,14 @@
111 SHORT_DATE_FORMAT
112 -----------------
113 
114+.. versionadded:: 1.2
115+
116 Default: ``m/d/Y`` (e.g. ``12/31/2003``)
117 
118-An available formatting that can be used for date fields on templates.
119-Note that if ``USE_L10N`` is set to ``True``, then locale format will
120-be applied. See :ttag:`allowed date format strings <now>`.
121+An available formatting that can be used for displaying date fields on
122+templates.  Note that if ``USE_L10N`` is set to ``True``, then the corresponding
123+locale-dictated format has higher precedence and will be applied. See
124+:ttag:`allowed date format strings <now>`.
125 
126 See also ``DATE_FORMAT`` and ``SHORT_DATETIME_FORMAT``.
127 
128@@ -1341,11 +1364,14 @@
129 SHORT_DATETIME_FORMAT
130 ---------------------
131 
132+.. versionadded:: 1.2
133+
134 Default: ``m/d/Y P`` (e.g. ``12/31/2003 4 p.m.``)
135 
136-An available formatting that can be used for datetime fields on templates.
137-Note that if ``USE_L10N`` is set to ``True``, then locale format will
138-be applied. See :ttag:`allowed date format strings <now>`.
139+An available formatting that can be used for displaying datetime fields on
140+templates.  Note that if ``USE_L10N`` is set to ``True``, then the corresponding
141+locale-dictated format has higher precedence and will be applied. See
142+:ttag:`allowed date format strings <now>`.
143 
144 See also ``DATE_FORMAT`` and ``SHORT_DATETIME_FORMAT``.
145 
146@@ -1461,6 +1487,8 @@
147 THOUSAND_SEPARATOR
148 ------------------
149 
150+.. versionadded:: 1.2
151+
152 Default ``,`` (Comma)
153 
154 Default thousand separator used when formatting numbers. This setting is
155@@ -1475,9 +1503,13 @@
156 
157 Default: ``'P'`` (e.g. ``4 p.m.``)
158 
159-The default formatting to use for time fields in any part of the system.
160-Note that if ``USE_L10N`` is set to ``True``, then locale format will
161-be applied. See :ttag:`allowed date format strings <now>`.
162+The default formatting to use for displaying time fields in any part of the
163+system.  Note that if setting:`USE_L10N` is set to ``True``, then the
164+locale-dictated format has higher precedence and will be applied instead. See
165+:ttag:`allowed date format strings <now>`.
166+
167+.. versionchanged:: 1.2
168+    This setting can now be overriden by setting ``USE_L10N`` to ``True``.
169 
170 See also ``DATE_FORMAT`` and ``DATETIME_FORMAT``.
171 
172@@ -1486,6 +1518,8 @@
173 TIME_INPUT_FORMATS
174 ------------------
175 
176+.. versionadded:: 1.2
177+
178 Default: ``('%H:%M:%S', '%H:%M')``
179 
180 A tuple of formats that will be accepted when inputting data on a time
181@@ -1556,6 +1590,8 @@
182 USE_L10N
183 --------
184 
185+.. versionadded:: 1.2
186+
187 Default ``False``
188 
189 A boolean that specifies if data will be localized by default or not. If this
190@@ -1583,6 +1619,8 @@
191 USE_THOUSAND_SEPARATOR
192 ----------------------
193 
194+.. versionadded:: 1.2
195+
196 Default ``False``
197 
198 A boolean that specifies wheter to display numbers using a thousand separator.
199diff --git a/docs/ref/templates/builtins.txt b/docs/ref/templates/builtins.txt
200--- a/docs/ref/templates/builtins.txt
201+++ b/docs/ref/templates/builtins.txt
202@@ -1010,7 +1010,7 @@
203 
204 If ``value`` is ``4``, then the output will be ``6``.
205 
206-.. versionchanged:: 1.2
207+.. versionchanged:: 1.2
208    The following behavior didn't exist in previous Django versions.
209 
210 This filter will first try to coerce both values to integers. If this fails,
211@@ -1026,7 +1026,7 @@
212 output will be ``[1, 2, 3, 4, 5, 6]``.
213 
214 .. warning::
215-   
216+
217     Keep in mind that strings that can both be coerced to integers will be,
218     and thus will be will be *summed*, not concatenated, as in the first
219     example above.
220@@ -1103,6 +1103,16 @@
221 ``datetime.datetime.now()``), the output will be the string
222 ``'Wed 09 Jan 2008'``.
223 
224+Another example:
225+
226+Assuming that :setting:`USE_L10N` is ``True`` and :setting:`LANGUAGE_CODE` is,
227+for example, ``"es"``, then for::
228+
229+    {{ value|date:"SHORT_DATE_FORMAT" }}
230+
231+the output will be the string ``"09/01/2008"`` (The ``"SHORT_DATE_FORMAT"``
232+format specifier for the ``es`` locale as shipped with Django is ``"d/m/Y"``).
233+
234 When used without a format string::
235 
236     {{ value|date }}
237@@ -1110,6 +1120,9 @@
238 ...the formatting string defined in the :setting:`DATE_FORMAT` setting will be
239 used, without applying any localization.
240 
241+.. versionchanged:: 1.2
242+    Predefined formats can now be influenced by the current locale.
243+
244 .. templatefilter:: default
245 
246 default
247@@ -1730,12 +1743,25 @@
248 If ``value`` is equivalent to ``datetime.datetime.now()``, the output will be
249 the string ``"01:23"``.
250 
251+Another example:
252+
253+Assuming that :setting:`USE_L10N` is ``True`` and :setting:`LANGUAGE_CODE` is,
254+for example, ``"de"``, then for::
255+
256+    {{ value|time:"TIME_FORMAT" }}
257+
258+the output will be the string ``"01:23:00"`` (The ``"TIME_FORMAT"`` format
259+specifier for the ``de`` locale as shipped with Django is ``"H:i:s"``).
260+
261 When used without a format string::
262 
263     {{ value|time }}
264 
265 ...the formatting string defined in the :setting:`TIME_FORMAT` setting will be
266-used, without aplying any localization.
267+used, without applying any localization.
268+
269+.. versionchanged:: 1.2
270+    Predefined formats can now be influenced by the current locale.
271 
272 .. templatefilter:: timesince
273 
274diff --git a/docs/topics/i18n/localization.txt b/docs/topics/i18n/localization.txt
275--- a/docs/topics/i18n/localization.txt
276+++ b/docs/topics/i18n/localization.txt
277@@ -247,6 +247,8 @@
278 Format localization
279 ===================
280 
281+.. versionadded:: 1.2
282+
283 Django's formatting system is disabled by default. To enable it, it's necessary
284 to set :setting:`USE_L10N = True <USE_L10N>` in your settings file.
285