Skip to content

Commit ffd5564

Browse files
committed
[soc2009/model-validation] Merged to trunk at r12070
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/model-validation@12073 bcc190cf-cafb-0310-a4f2-bffc1f526a37
1 parent a7c320f commit ffd5564

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+1653
-357
lines changed

AUTHORS

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,11 @@ answer newbie questions, and generally made Django that much better:
2828

2929
ajs <adi@sieker.info>
3030
alang@bright-green.com
31+
Alcides Fonseca
3132
Andi Albrecht <albrecht.andi@gmail.com>
3233
Marty Alchin <gulopine@gamemusic.org>
3334
Ahmad Alhashemi <trans@ahmadh.com>
35+
Ahmad Al-Ibrahim
3436
Daniel Alves Barbosa de Oliveira Vaz <danielvaz@gmail.com>
3537
AgarFu <heaven@croasanaso.sytes.net>
3638
Dagur Páll Ammendrup <dagurp@gmail.com>
@@ -188,13 +190,15 @@ answer newbie questions, and generally made Django that much better:
188190
Simon Greenhill <dev@simon.net.nz>
189191
Owen Griffiths
190192
Espen Grindhaug <http://grindhaug.org/>
193+
Janos Guljas
191194
Thomas Güttler <hv@tbz-pariv.de>
192195
Horst Gutmann <zerok@zerokspot.com>
193196
Scot Hacker <shacker@birdhouse.org>
194197
dAniel hAhler
195198
hambaloney
196199
Brian Harring <ferringb@gmail.com>
197200
Brant Harris
201+
Ronny Haryanto <http://ronny.haryan.to/>
198202
Hawkeye
199203
Joe Heck <http://www.rhonabwy.com/wp/>
200204
Joel Heenan <joelh-django@planetjoel.com>
@@ -384,6 +388,7 @@ answer newbie questions, and generally made Django that much better:
384388
Rozza <ross.lawley@gmail.com>
385389
Oliver Rutherfurd <http://rutherfurd.net/>
386390
ryankanno
391+
Gonzalo Saavedra <gonzalosaavedra@gmail.com>
387392
Manuel Saelices <msaelices@yaco.es>
388393
Ivan Sagalaev (Maniac) <http://www.softwaremaniacs.org/>
389394
Vinay Sajip <vinay_sajip@yahoo.co.uk>
@@ -482,6 +487,7 @@ answer newbie questions, and generally made Django that much better:
482487
ymasuda@ethercube.com
483488
Jesse Young <adunar@gmail.com>
484489
Mykola Zamkovoi <nickzam@gmail.com>
490+
zegor
485491
Gasper Zejn <zejn@kiberpipa.org>
486492
Jarek Zgoda <jarek.zgoda@gmail.com>
487493
Cheng Zhang

django/conf/global_settings.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@
8484
('sk', gettext_noop('Slovak')),
8585
('sl', gettext_noop('Slovenian')),
8686
('sr', gettext_noop('Serbian')),
87+
('sr-latn', gettext_noop('Serbian Latin')),
8788
('sv', gettext_noop('Swedish')),
8889
('ta', gettext_noop('Tamil')),
8990
('te', gettext_noop('Telugu')),

django/conf/locale/it/formats.py

Lines changed: 35 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,40 @@
22
# This file is distributed under the same license as the Django package.
33
#
44

5-
DATE_FORMAT = 'd F Y'
6-
TIME_FORMAT = 'H.i.s'
7-
# DATETIME_FORMAT =
8-
YEAR_MONTH_FORMAT = 'F Y'
9-
MONTH_DAY_FORMAT = 'j F'
10-
SHORT_DATE_FORMAT = 'd/M/Y'
11-
# SHORT_DATETIME_FORMAT =
12-
# FIRST_DAY_OF_WEEK =
13-
# DATE_INPUT_FORMATS =
14-
# TIME_INPUT_FORMATS =
15-
# DATETIME_INPUT_FORMATS =
5+
DATE_FORMAT = 'd F Y' # 25 Ottobre 2006
6+
TIME_FORMAT = 'H:i:s' # 14:30:59
7+
DATETIME_FORMAT = 'w d F Y H:i:s' # Mercoledì 25 Ottobre 2006 14:30:59
8+
YEAR_MONTH_FORMAT = 'F Y' # Ottobre 2006
9+
MONTH_DAY_FORMAT = 'j/F' # 10/2006
10+
SHORT_DATE_FORMAT = 'd/M/Y' # 25/12/2009
11+
SHORT_DATETIME_FORMAT = 'd/M/Y H:i:s' # 25/10/2009 14:30:59
12+
FIRST_DAY_OF_WEEK = 1 # Lunedì
13+
DATE_INPUT_FORMATS = (
14+
'%Y-%m-%d', '%Y/%m/%d', # '2008-10-25', '2008/10/25'
15+
'%d-%m-%Y', '%d/%m/%Y', # '25-10-2006', '25/10/2006'
16+
'%d-%m-%y', '%d/%m/%y', # '25-10-06', '25/10/06'
17+
)
18+
TIME_INPUT_FORMATS = (
19+
'%H:%M:%S', # '14:30:59'
20+
'%H:%M', # '14:30'
21+
)
22+
DATETIME_INPUT_FORMATS = (
23+
'%Y-%m-%d %H:%M:%S', # '2006-10-25 14:30:59'
24+
'%Y-%m-%d %H:%M', # '2006-10-25 14:30'
25+
'%Y-%m-%d', # '2006-10-25'
26+
'%d-%m-%Y %H:%M:%S', # '25-10-2006 14:30:59'
27+
'%d-%m-%Y %H:%M', # '25-10-2006 14:30'
28+
'%d-%m-%Y', # '25-10-2006'
29+
'%d-%m-%y %H:%M:%S', # '25-10-06 14:30:59'
30+
'%d-%m-%y %H:%M', # '25-10-06 14:30'
31+
'%d-%m-%y', # '25-10-06'
32+
'%d/%m/%Y %H:%M:%S', # '25/10/2006 14:30:59'
33+
'%d/%m/%Y %H:%M', # '25/10/2006 14:30'
34+
'%d/%m/%Y', # '25/10/2006'
35+
'%d/%m/%y %H:%M:%S', # '25/10/06 14:30:59'
36+
'%d/%m/%y %H:%M', # '25/10/06 14:30'
37+
'%d/%m/%y', # '25/10/06'
38+
)
1639
DECIMAL_SEPARATOR = ','
1740
THOUSAND_SEPARATOR = '.'
18-
# NUMBER_GROUPING =
41+
NUMBER_GROUPING = 3

django/conf/locale/no/formats.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,19 @@
1414
'%j. %B %Y', '%j %B %Y', # '25. oktober 2006', '25 oktober 2006'
1515
)
1616
TIME_INPUT_FORMATS = (
17-
'%H:%i:%S', # '14:30:59'
18-
'%H:%i', # '14:30'
17+
'%H:%M:%S', # '14:30:59'
18+
'%H:%M', # '14:30'
1919
)
2020
DATETIME_INPUT_FORMATS = (
21-
'%Y-%m-%d %H:%i:%S', # '2006-10-25 14:30:59'
22-
'%Y-%m-%d %H:%i', # '2006-10-25 14:30'
21+
'%Y-%m-%d %H:%M:%S', # '2006-10-25 14:30:59'
22+
'%Y-%m-%d %H:%M', # '2006-10-25 14:30'
2323
'%Y-%m-%d', # '2006-10-25'
2424
'%Y-%m-%j', # '2006-10-25'
25-
'%j.%m.%Y %H:%i:%S', # '25.10.2006 14:30:59'
26-
'%j.%m.%Y %H:%i', # '25.10.2006 14:30'
25+
'%j.%m.%Y %H:%M:%S', # '25.10.2006 14:30:59'
26+
'%j.%m.%Y %H:%M', # '25.10.2006 14:30'
2727
'%j.%m.%Y', # '25.10.2006'
28-
'%j.%m.%y %H:%i:%S', # '25.10.06 14:30:59'
29-
'%j.%m.%y %H:%i', # '25.10.06 14:30'
28+
'%j.%m.%y %H:%M:%S', # '25.10.06 14:30:59'
29+
'%j.%m.%y %H:%M', # '25.10.06 14:30'
3030
'%j.%m.%y', # '25.10.06'
3131
)
3232
DECIMAL_SEPARATOR = ','

django/conf/locale/pl/LC_MESSAGES/django.po

Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ msgid ""
55
msgstr ""
66
"Project-Id-Version: Django\n"
77
"Report-Msgid-Bugs-To: \n"
8-
"POT-Creation-Date: 2009-12-23 12:55+0100\n"
8+
"POT-Creation-Date: 2009-12-30 08:54+0100\n"
99
"PO-Revision-Date: 2008-02-25 15:53+0100\n"
1010
"Last-Translator: Jarek Zgoda <jarek.zgoda@gmail.com>\n"
1111
"MIME-Version: 1.0\n"
@@ -223,7 +223,7 @@ msgstr "chiński tradycyjny"
223223
msgid "Successfully deleted %(count)d %(items)s."
224224
msgstr "Usunięto %(count)d %(items)s."
225225

226-
#: contrib/admin/actions.py:67 contrib/admin/options.py:1073
226+
#: contrib/admin/actions.py:67 contrib/admin/options.py:1075
227227
msgid "Are you sure?"
228228
msgstr "Jesteś pewien?"
229229

@@ -314,107 +314,107 @@ msgstr "logi"
314314
msgid "None"
315315
msgstr "brak"
316316

317-
#: contrib/admin/options.py:540
317+
#: contrib/admin/options.py:554
318318
#, python-format
319319
msgid "Changed %s."
320320
msgstr "Zmieniono %s"
321321

322-
#: contrib/admin/options.py:540 contrib/admin/options.py:550
322+
#: contrib/admin/options.py:554 contrib/admin/options.py:564
323323
#: contrib/comments/templates/comments/preview.html:16 forms/models.py:385
324324
#: forms/models.py:598
325325
msgid "and"
326326
msgstr "i"
327327

328-
#: contrib/admin/options.py:545
328+
#: contrib/admin/options.py:559
329329
#, python-format
330330
msgid "Added %(name)s \"%(object)s\"."
331331
msgstr "Dodano %(name)s \"%(object)s\"."
332332

333-
#: contrib/admin/options.py:549
333+
#: contrib/admin/options.py:563
334334
#, python-format
335335
msgid "Changed %(list)s for %(name)s \"%(object)s\"."
336336
msgstr "Zmieniono %(list)s w %(name)s \"%(object)s\"."
337337

338-
#: contrib/admin/options.py:554
338+
#: contrib/admin/options.py:568
339339
#, python-format
340340
msgid "Deleted %(name)s \"%(object)s\"."
341341
msgstr "Usunięto %(name)s \"%(object)s\"."
342342

343-
#: contrib/admin/options.py:558
343+
#: contrib/admin/options.py:572
344344
msgid "No fields changed."
345345
msgstr "Żadne pole nie zmienione."
346346

347-
#: contrib/admin/options.py:620 contrib/auth/admin.py:68
347+
#: contrib/admin/options.py:634 contrib/auth/admin.py:68
348348
#, python-format
349349
msgid "The %(name)s \"%(obj)s\" was added successfully."
350350
msgstr "%(name)s \"%(obj)s\" dodany pomyślnie."
351351

352-
#: contrib/admin/options.py:624 contrib/admin/options.py:657
352+
#: contrib/admin/options.py:638 contrib/admin/options.py:671
353353
#: contrib/auth/admin.py:77
354354
msgid "You may edit it again below."
355355
msgstr "Możesz ponownie edytować wpis poniżej."
356356

357-
#: contrib/admin/options.py:634 contrib/admin/options.py:667
357+
#: contrib/admin/options.py:648 contrib/admin/options.py:681
358358
#, python-format
359359
msgid "You may add another %s below."
360360
msgstr "Możesz dodać nowy wpis %s poniżej."
361361

362-
#: contrib/admin/options.py:655
362+
#: contrib/admin/options.py:669
363363
#, python-format
364364
msgid "The %(name)s \"%(obj)s\" was changed successfully."
365365
msgstr "%(name)s \"%(obj)s\" zostało pomyślnie zmienione."
366366

367-
#: contrib/admin/options.py:663
367+
#: contrib/admin/options.py:677
368368
#, python-format
369369
msgid ""
370370
"The %(name)s \"%(obj)s\" was added successfully. You may edit it again below."
371371
msgstr ""
372372
"%(name)s \"%(obj)s\" dodane pomyślnie. Możesz edytować ponownie wpis poniżej."
373373

374-
#: contrib/admin/options.py:714
374+
#: contrib/admin/options.py:728
375375
msgid ""
376376
"Items must be selected in order to perform actions on them. No items have "
377377
"been changed."
378378
msgstr ""
379379
"Wykonanie akcji wymaga wybrania obiektów. Żaden obiekt nie został zmieniony."
380380

381-
#: contrib/admin/options.py:728
381+
#: contrib/admin/options.py:742
382382
msgid "No action selected."
383383
msgstr "Nie wybrano akcji."
384384

385-
#: contrib/admin/options.py:808
385+
#: contrib/admin/options.py:822
386386
#, python-format
387387
msgid "Add %s"
388388
msgstr "Dodaj %s"
389389

390-
#: contrib/admin/options.py:840 contrib/admin/options.py:1051
390+
#: contrib/admin/options.py:848 contrib/admin/options.py:1053
391391
#, python-format
392392
msgid "%(name)s object with primary key %(key)r does not exist."
393393
msgstr "Obiekt %(name)s o kluczu głównym %(key)r nie istnieje."
394394

395-
#: contrib/admin/options.py:905
395+
#: contrib/admin/options.py:913
396396
#, python-format
397397
msgid "Change %s"
398398
msgstr "Zmień %s"
399399

400-
#: contrib/admin/options.py:950
400+
#: contrib/admin/options.py:958
401401
msgid "Database error"
402402
msgstr "Błąd bazy danych"
403403

404-
#: contrib/admin/options.py:986
404+
#: contrib/admin/options.py:994
405405
#, python-format
406406
msgid "%(count)s %(name)s was changed successfully."
407407
msgid_plural "%(count)s %(name)s were changed successfully."
408408
msgstr[0] "%(count)s %(name)s został pomyślnie zmieniony."
409409
msgstr[1] "%(count)s %(name)s zostały pomyślnie zmienione."
410410
msgstr[2] "%(count)s %(name)s zostało pomyślnie zmienionych."
411411

412-
#: contrib/admin/options.py:1066
412+
#: contrib/admin/options.py:1068
413413
#, python-format
414414
msgid "The %(name)s \"%(obj)s\" was deleted successfully."
415415
msgstr "%(name)s \"%(obj)s\" usunięty pomyślnie."
416416

417-
#: contrib/admin/options.py:1103
417+
#: contrib/admin/options.py:1105
418418
#, python-format
419419
msgid "Change history: %s"
420420
msgstr "Historia zmian: %s"
@@ -546,9 +546,8 @@ msgid ""
546546
"There's been an error. It's been reported to the site administrators via e-"
547547
"mail and should be fixed shortly. Thanks for your patience."
548548
msgstr ""
549-
"Wystąpił niespodziewany błąd. Raport został wysłany e-mailem "
550-
"administratorowi strony i powinien zostać wkrótce naprawiony. Dziękujemy za "
551-
"cierpliwość."
549+
"Wystąpił niespodziewany błąd. Został on zgłoszony e-mailem administratorowi "
550+
"strony i powinien zostać wkrótce naprawiony. Dziękujemy za cierpliwość."
552551

553552
#: contrib/admin/templates/admin/actions.html:4
554553
msgid "Run the selected action"

django/contrib/admin/media/js/admin/DateTimeShortcuts.js

Lines changed: 26 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ var DateTimeShortcuts = {
4444
var shortcuts_span = document.createElement('span');
4545
inp.parentNode.insertBefore(shortcuts_span, inp.nextSibling);
4646
var now_link = document.createElement('a');
47-
now_link.setAttribute('href', "javascript:DateTimeShortcuts.handleClockQuicklink(" + num + ", new Date().getHourMinuteSecond());");
47+
now_link.setAttribute('href', "javascript:DateTimeShortcuts.handleClockQuicklink(" + num + ", new Date().strftime('" + gettext('TIME_INPUT_FORMATS') + "'));");
4848
now_link.appendChild(document.createTextNode(gettext('Now')));
4949
var clock_link = document.createElement('a');
5050
clock_link.setAttribute('href', 'javascript:DateTimeShortcuts.openClock(' + num + ');');
@@ -80,10 +80,10 @@ var DateTimeShortcuts = {
8080
quickElement('h2', clock_box, gettext('Choose a time'));
8181
time_list = quickElement('ul', clock_box, '');
8282
time_list.className = 'timelist';
83-
quickElement("a", quickElement("li", time_list, ""), gettext("Now"), "href", "javascript:DateTimeShortcuts.handleClockQuicklink(" + num + ", new Date().getHourMinuteSecond());")
84-
quickElement("a", quickElement("li", time_list, ""), gettext("Midnight"), "href", "javascript:DateTimeShortcuts.handleClockQuicklink(" + num + ", '00:00:00');")
85-
quickElement("a", quickElement("li", time_list, ""), gettext("6 a.m."), "href", "javascript:DateTimeShortcuts.handleClockQuicklink(" + num + ", '06:00:00');")
86-
quickElement("a", quickElement("li", time_list, ""), gettext("Noon"), "href", "javascript:DateTimeShortcuts.handleClockQuicklink(" + num + ", '12:00:00');")
83+
quickElement("a", quickElement("li", time_list, ""), gettext("Now"), "href", "javascript:DateTimeShortcuts.handleClockQuicklink(" + num + ", new Date().strftime('" + gettext('TIME_INPUT_FORMATS') + "'));");
84+
quickElement("a", quickElement("li", time_list, ""), gettext("Midnight"), "href", "javascript:DateTimeShortcuts.handleClockQuicklink(" + num + ", new Date(1970,1,1,0,0,0,0).strftime('" + gettext('TIME_INPUT_FORMATS') + "'));");
85+
quickElement("a", quickElement("li", time_list, ""), gettext("6 a.m."), "href", "javascript:DateTimeShortcuts.handleClockQuicklink(" + num + ", new Date(1970,1,1,6,0,0,0).strftime('" + gettext('TIME_INPUT_FORMATS') + "'));");
86+
quickElement("a", quickElement("li", time_list, ""), gettext("Noon"), "href", "javascript:DateTimeShortcuts.handleClockQuicklink(" + num + ", new Date(1970,1,1,12,0,0,0).strftime('" + gettext('TIME_INPUT_FORMATS') + "'));");
8787

8888
cancel_p = quickElement('p', clock_box, '');
8989
cancel_p.className = 'calendar-cancel';
@@ -195,20 +195,19 @@ var DateTimeShortcuts = {
195195
openCalendar: function(num) {
196196
var cal_box = document.getElementById(DateTimeShortcuts.calendarDivName1+num)
197197
var cal_link = document.getElementById(DateTimeShortcuts.calendarLinkName+num)
198-
var inp = DateTimeShortcuts.calendarInputs[num];
199-
200-
// Determine if the current value in the input has a valid date.
201-
// If so, draw the calendar with that date's year and month.
202-
if (inp.value) {
203-
var date_parts = inp.value.split('-');
204-
var year = date_parts[0];
205-
var month = parseFloat(date_parts[1]);
206-
if (year.match(/\d\d\d\d/) && month >= 1 && month <= 12) {
207-
DateTimeShortcuts.calendars[num].drawDate(month, year);
208-
}
209-
}
198+
var inp = DateTimeShortcuts.calendarInputs[num];
199+
200+
// Determine if the current value in the input has a valid date.
201+
// If so, draw the calendar with that date's year and month.
202+
if (inp.value) {
203+
var date_parts = inp.value.split('-');
204+
var year = date_parts[0];
205+
var month = parseFloat(date_parts[1]);
206+
if (year.match(/\d\d\d\d/) && month >= 1 && month <= 12) {
207+
DateTimeShortcuts.calendars[num].drawDate(month, year);
208+
}
209+
}
210210

211-
212211
// Recalculate the clockbox position
213212
// is it left-to-right or right-to-left layout ?
214213
if (getStyle(document.body,'direction')!='rtl') {
@@ -237,12 +236,19 @@ var DateTimeShortcuts = {
237236
DateTimeShortcuts.calendars[num].drawNextMonth();
238237
},
239238
handleCalendarCallback: function(num) {
240-
return "function(y, m, d) { DateTimeShortcuts.calendarInputs["+num+"].value = y+'-'+(m<10?'0':'')+m+'-'+(d<10?'0':'')+d; document.getElementById(DateTimeShortcuts.calendarDivName1+"+num+").style.display='none';}";
239+
format = gettext('DATE_INPUT_FORMATS');
240+
// the format needs to be escaped a little
241+
format = format.replace('\\', '\\\\');
242+
format = format.replace('\r', '\\r');
243+
format = format.replace('\n', '\\n');
244+
format = format.replace('\t', '\\t');
245+
format = format.replace("'", "\\'");
246+
return "function(y, m, d) { DateTimeShortcuts.calendarInputs["+num+"].value = new Date(y, m-1, d).strftime('"+format+"');document.getElementById(DateTimeShortcuts.calendarDivName1+"+num+").style.display='none';}";
241247
},
242248
handleCalendarQuickLink: function(num, offset) {
243249
var d = new Date();
244250
d.setDate(d.getDate() + offset)
245-
DateTimeShortcuts.calendarInputs[num].value = d.getISODate();
251+
DateTimeShortcuts.calendarInputs[num].value = d.strftime(gettext('DATE_INPUT_FORMATS'));
246252
DateTimeShortcuts.dismissCalendar(num);
247253
},
248254
cancelEventPropagation: function(e) {

0 commit comments

Comments
 (0)