mirror of
https://github.com/django/django.git
synced 2025-07-04 17:59:13 +00:00
boulder-oracle-sprint: Merged to [4775] of trunk.
git-svn-id: http://code.djangoproject.com/svn/django/branches/boulder-oracle-sprint@4777 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
4a4417787b
commit
c4eb6bf708
1
AUTHORS
1
AUTHORS
@ -133,6 +133,7 @@ answer newbie questions, and generally made Django that much better:
|
||||
masonsimon+django@gmail.com
|
||||
Manuzhai
|
||||
Petar Marić <http://www.petarmaric.com/>
|
||||
Nuno Mariz <nmariz@gmail.com>
|
||||
mark@junklight.com
|
||||
Yasushi Masuda <whosaysni@gmail.com>
|
||||
mattycakes@gmail.com
|
||||
|
@ -61,6 +61,7 @@ LANGUAGES = (
|
||||
('nl', gettext_noop('Dutch')),
|
||||
('no', gettext_noop('Norwegian')),
|
||||
('pl', gettext_noop('Polish')),
|
||||
('pt', gettext_noop('Portugese')),
|
||||
('pt-br', gettext_noop('Brazilian')),
|
||||
('ro', gettext_noop('Romanian')),
|
||||
('ru', gettext_noop('Russian')),
|
||||
|
Binary file not shown.
@ -11,7 +11,7 @@ msgstr ""
|
||||
"Project-Id-Version: django\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2007-02-26 20:44+0100\n"
|
||||
"PO-Revision-Date: 2007-02-27 20:06+0100\n"
|
||||
"PO-Revision-Date: 2007-03-14 19:29+0100\n"
|
||||
"Last-Translator: Nicola Larosa <nico@tekNico.net>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
@ -523,7 +523,7 @@ msgstr ""
|
||||
|
||||
#: contrib/auth/forms.py:17 contrib/auth/forms.py:138
|
||||
msgid "The two password fields didn't match."
|
||||
msgstr "I due campi parola chiave non corrispondono."
|
||||
msgstr "I due campi password non corrispondono."
|
||||
|
||||
#: contrib/auth/forms.py:25
|
||||
msgid "A user with that username already exists."
|
||||
@ -555,7 +555,7 @@ msgstr "Questo indirizzo email non è associato ad alcun account utente. Sei sic
|
||||
|
||||
#: contrib/auth/forms.py:117
|
||||
msgid "The two 'new password' fields didn't match."
|
||||
msgstr "I due campi 'nuova parola chiave' non corrispondono."
|
||||
msgstr "I due campi 'nuova password' non corrispondono."
|
||||
|
||||
#: contrib/auth/forms.py:124
|
||||
msgid "Your old password was entered incorrectly. Please enter it again."
|
||||
@ -609,13 +609,13 @@ msgstr "indirizzo e-mail"
|
||||
|
||||
#: contrib/auth/models.py:94
|
||||
msgid "password"
|
||||
msgstr "parola chiave"
|
||||
msgstr "password"
|
||||
|
||||
#: contrib/auth/models.py:94
|
||||
msgid ""
|
||||
"Use '[algo]$[salt]$[hexdigest]' or use the <a href=\"password/\">change "
|
||||
"password form</a>."
|
||||
msgstr "Usare '[algo]$[salt]$[hexdigest]' oppure la maschera di <a href=\"password/\">cambio parola chiave</a>."
|
||||
msgstr "Usare '[algo]$[salt]$[hexdigest]' oppure la maschera di <a href=\"password/\">cambio password</a>."
|
||||
|
||||
#: contrib/auth/models.py:95
|
||||
msgid "staff status"
|
||||
@ -1040,12 +1040,12 @@ msgstr "Aggiungi utente"
|
||||
|
||||
#: contrib/admin/views/auth.py:57
|
||||
msgid "Password changed successfully."
|
||||
msgstr "La parola chiave è stata cambiata correttamente."
|
||||
msgstr "La password è stata cambiata correttamente."
|
||||
|
||||
#: contrib/admin/views/auth.py:64
|
||||
#, python-format
|
||||
msgid "Change password: %s"
|
||||
msgstr "Cambia la parola chiave: %s"
|
||||
msgstr "Cambia la password: %s"
|
||||
|
||||
#: contrib/admin/templatetags/admin_list.py:247
|
||||
msgid "All dates"
|
||||
@ -1088,7 +1088,7 @@ msgstr "Documentazione"
|
||||
#: contrib/admin/templates/registration/password_change_form.html:3
|
||||
#: contrib/admin/templates/registration/password_change_done.html:3
|
||||
msgid "Change password"
|
||||
msgstr "Cambia la parola chiave"
|
||||
msgstr "Cambia la password"
|
||||
|
||||
#: contrib/admin/templates/admin/delete_confirmation.html:3
|
||||
#: contrib/admin/templates/admin/change_form.html:10
|
||||
@ -1335,11 +1335,11 @@ msgstr "Nome utente:"
|
||||
#: contrib/admin/templates/admin/login.html:20
|
||||
#: contrib/comments/templates/comments/form.html:8
|
||||
msgid "Password:"
|
||||
msgstr "Parola chiave:"
|
||||
msgstr "Password:"
|
||||
|
||||
#: contrib/admin/templates/admin/login.html:22
|
||||
msgid "Have you <a href=\"/password_reset/\">forgotten your password</a>?"
|
||||
msgstr "Hai <a href=\"/password_reset/\">dimenticato la parola chiave</a>?"
|
||||
msgstr "Hai <a href=\"/password_reset/\">dimenticato la password</a>?"
|
||||
|
||||
#: contrib/admin/templates/admin/base.html:25
|
||||
msgid "Welcome,"
|
||||
@ -1349,7 +1349,7 @@ msgstr "Benvenuto,"
|
||||
msgid ""
|
||||
"First, enter a username and password. Then, you'll be able to edit more user "
|
||||
"options."
|
||||
msgstr "Inserire innanzitutto nome utente e parola chiave. Si potrà quindi modificare le altre impostazioni dell'utente."
|
||||
msgstr "Inserire innanzitutto nome utente e password. Si potrà quindi modificare le altre impostazioni dell'utente."
|
||||
|
||||
#: contrib/admin/templates/admin/auth/user/add_form.html:12
|
||||
msgid "Username"
|
||||
@ -1358,22 +1358,22 @@ msgstr "Nome utente"
|
||||
#: contrib/admin/templates/admin/auth/user/add_form.html:18
|
||||
#: contrib/admin/templates/admin/auth/user/change_password.html:34
|
||||
msgid "Password"
|
||||
msgstr "Parola chiave"
|
||||
msgstr "Password"
|
||||
|
||||
#: contrib/admin/templates/admin/auth/user/add_form.html:23
|
||||
#: contrib/admin/templates/admin/auth/user/change_password.html:39
|
||||
msgid "Password (again)"
|
||||
msgstr "Parola chiave (di nuovo)"
|
||||
msgstr "Password (di nuovo)"
|
||||
|
||||
#: contrib/admin/templates/admin/auth/user/add_form.html:24
|
||||
#: contrib/admin/templates/admin/auth/user/change_password.html:40
|
||||
msgid "Enter the same password as above, for verification."
|
||||
msgstr "Inserire la stessa parola chiave inserita sopra, come verifica."
|
||||
msgstr "Inserire la stessa password inserita sopra, come verifica."
|
||||
|
||||
#: contrib/admin/templates/admin/auth/user/change_password.html:28
|
||||
#, python-format
|
||||
msgid "Enter a new password for the user <strong>%(username)s</strong>."
|
||||
msgstr "Inserire una nuova parola chiave per l'utente <strong>%(username)s</strong>."
|
||||
msgstr "Inserire una nuova password per l'utente <strong>%(username)s</strong>."
|
||||
|
||||
#: contrib/admin/templates/admin_doc/bookmarklets.html:3
|
||||
msgid "Bookmarklets"
|
||||
@ -1460,13 +1460,13 @@ msgstr "Modifica:"
|
||||
#: contrib/admin/templates/registration/password_reset_form.html:10
|
||||
#: contrib/admin/templates/registration/password_reset_done.html:4
|
||||
msgid "Password reset"
|
||||
msgstr "Reimposta la parola chiave"
|
||||
msgstr "Reimposta la password"
|
||||
|
||||
#: contrib/admin/templates/registration/password_reset_form.html:12
|
||||
msgid ""
|
||||
"Forgotten your password? Enter your e-mail address below, and we'll reset "
|
||||
"your password and e-mail the new one to you."
|
||||
msgstr "Dimenticata la parola chiave? Inserire il proprio indirizzo e-mail qui sotto: la parola chiave sarà reimpostata, e la nuova ti verrà inviata per e-mail."
|
||||
msgstr "Dimenticata la password? Inserire il proprio indirizzo e-mail qui sotto: la password sarà reimpostata, e la nuova ti verrà inviata per e-mail."
|
||||
|
||||
#: contrib/admin/templates/registration/password_reset_form.html:16
|
||||
msgid "E-mail address:"
|
||||
@ -1474,11 +1474,11 @@ msgstr "Indirizzo e-mail:"
|
||||
|
||||
#: contrib/admin/templates/registration/password_reset_form.html:16
|
||||
msgid "Reset my password"
|
||||
msgstr "Reimposta la mia parola chiave"
|
||||
msgstr "Reimposta la mia password"
|
||||
|
||||
#: contrib/admin/templates/registration/password_reset_email.html:2
|
||||
msgid "You're receiving this e-mail because you requested a password reset"
|
||||
msgstr "Hai ricevuto questa e-mail perché hai chiesto di reimpostare la parola chiave"
|
||||
msgstr "Hai ricevuto questa e-mail perché hai chiesto di reimpostare la password"
|
||||
|
||||
#: contrib/admin/templates/registration/password_reset_email.html:3
|
||||
#, python-format
|
||||
@ -1488,11 +1488,11 @@ msgstr "per il tuo account utente su %(site_name)s"
|
||||
#: contrib/admin/templates/registration/password_reset_email.html:5
|
||||
#, python-format
|
||||
msgid "Your new password is: %(new_password)s"
|
||||
msgstr "La tua nuova parola chiave è: %(new_password)s"
|
||||
msgstr "La tua nuova password è: %(new_password)s"
|
||||
|
||||
#: contrib/admin/templates/registration/password_reset_email.html:7
|
||||
msgid "Feel free to change this password by going to this page:"
|
||||
msgstr "Puoi liberamente cambiare la tua parola chiave tramite questa pagina:"
|
||||
msgstr "Puoi liberamente cambiare la tua password tramite questa pagina:"
|
||||
|
||||
#: contrib/admin/templates/registration/password_reset_email.html:11
|
||||
msgid "Your username, in case you've forgotten:"
|
||||
@ -1518,51 +1518,51 @@ msgstr "Accedi di nuovo"
|
||||
#: contrib/admin/templates/registration/password_reset_done.html:6
|
||||
#: contrib/admin/templates/registration/password_reset_done.html:10
|
||||
msgid "Password reset successful"
|
||||
msgstr "Parola chiave reimpostata correttamente"
|
||||
msgstr "Password reimpostata correttamente"
|
||||
|
||||
#: contrib/admin/templates/registration/password_reset_done.html:12
|
||||
msgid ""
|
||||
"We've e-mailed a new password to the e-mail address you submitted. You "
|
||||
"should be receiving it shortly."
|
||||
msgstr "La nuova parola chiave è stata inviata all'indirizzo e-mail inserito. Arriverà a breve."
|
||||
msgstr "La nuova password è stata inviata all'indirizzo e-mail inserito. Arriverà a breve."
|
||||
|
||||
#: contrib/admin/templates/registration/password_change_form.html:4
|
||||
#: contrib/admin/templates/registration/password_change_form.html:6
|
||||
#: contrib/admin/templates/registration/password_change_form.html:10
|
||||
#: contrib/admin/templates/registration/password_change_done.html:4
|
||||
msgid "Password change"
|
||||
msgstr "Cambio di parola chiave"
|
||||
msgstr "Cambio password"
|
||||
|
||||
#: contrib/admin/templates/registration/password_change_form.html:12
|
||||
msgid ""
|
||||
"Please enter your old password, for security's sake, and then enter your new "
|
||||
"password twice so we can verify you typed it in correctly."
|
||||
msgstr "Inserire l'attuale parola chiave, per ragioni di sicurezza, e poi la nuova parola chiave due volte, per verificare di averla scritta correttamente."
|
||||
msgstr "Inserire l'attuale password, per ragioni di sicurezza, e poi la nuova password due volte, per verificare di averla scritta correttamente."
|
||||
|
||||
#: contrib/admin/templates/registration/password_change_form.html:17
|
||||
msgid "Old password:"
|
||||
msgstr "Parola chiave attuale:"
|
||||
msgstr "Password attuale:"
|
||||
|
||||
#: contrib/admin/templates/registration/password_change_form.html:19
|
||||
msgid "New password:"
|
||||
msgstr "Nuova parola chiave:"
|
||||
msgstr "Nuova password:"
|
||||
|
||||
#: contrib/admin/templates/registration/password_change_form.html:21
|
||||
msgid "Confirm password:"
|
||||
msgstr "Confermare la parola chiave:"
|
||||
msgstr "Confermare la password:"
|
||||
|
||||
#: contrib/admin/templates/registration/password_change_form.html:23
|
||||
msgid "Change my password"
|
||||
msgstr "Modifica la mia parola chiave"
|
||||
msgstr "Modifica la mia password"
|
||||
|
||||
#: contrib/admin/templates/registration/password_change_done.html:6
|
||||
#: contrib/admin/templates/registration/password_change_done.html:10
|
||||
msgid "Password change successful"
|
||||
msgstr "Cambio di parola chiave avvenuto correttamente"
|
||||
msgstr "Cambio di password avvenuto correttamente"
|
||||
|
||||
#: contrib/admin/templates/registration/password_change_done.html:12
|
||||
msgid "Your password was changed."
|
||||
msgstr "La parola chiave è stata cambiata."
|
||||
msgstr "La password è stata cambiata."
|
||||
|
||||
#: contrib/sites/models.py:10
|
||||
msgid "domain name"
|
||||
@ -1905,7 +1905,7 @@ msgstr "Il modulo di commento non fornisce né 'anteprima' né 'invia'"
|
||||
|
||||
#: contrib/comments/templates/comments/form.html:8
|
||||
msgid "Forgotten your password?"
|
||||
msgstr "Hai dimenticato la parola chiave?"
|
||||
msgstr "Hai dimenticato la password?"
|
||||
|
||||
#: contrib/comments/templates/comments/form.html:12
|
||||
msgid "Ratings"
|
||||
|
BIN
django/conf/locale/pl/LC_MESSAGES/djangojs.mo
Normal file
BIN
django/conf/locale/pl/LC_MESSAGES/djangojs.mo
Normal file
Binary file not shown.
112
django/conf/locale/pl/LC_MESSAGES/djangojs.po
Normal file
112
django/conf/locale/pl/LC_MESSAGES/djangojs.po
Normal file
@ -0,0 +1,112 @@
|
||||
# translation of djangojs.po to Polish
|
||||
# Copyright (C) 2007 Michal Chruszcz
|
||||
# This file is distributed under the same license as the django package.
|
||||
#
|
||||
# Michal Chruszcz <troll@pld-linux.org>, 2007.
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: 0.1\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2005-12-09 11:51+0100\n"
|
||||
"PO-Revision-Date: 2007-03-12 11:42+0100\n"
|
||||
"Last-Translator: Michal Chruszcz <troll@pld-linux.org>\n"
|
||||
"Language-Team: Polish <pl@li.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Generator: KBabel 1.11.4\n"
|
||||
"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
|
||||
|
||||
#: contrib/admin/media/js/SelectFilter2.js:33
|
||||
#, perl-format
|
||||
msgid "Available %s"
|
||||
msgstr "Dostępne %s"
|
||||
|
||||
#: contrib/admin/media/js/SelectFilter2.js:41
|
||||
msgid "Choose all"
|
||||
msgstr "Wybierz wszystko"
|
||||
|
||||
#: contrib/admin/media/js/SelectFilter2.js:46
|
||||
msgid "Add"
|
||||
msgstr "Dodaj"
|
||||
|
||||
#: contrib/admin/media/js/SelectFilter2.js:48
|
||||
msgid "Remove"
|
||||
msgstr "Usuń"
|
||||
|
||||
#: contrib/admin/media/js/SelectFilter2.js:53
|
||||
#, perl-format
|
||||
msgid "Chosen %s"
|
||||
msgstr "Wybrano %s"
|
||||
|
||||
#: contrib/admin/media/js/SelectFilter2.js:54
|
||||
#, fuzzy
|
||||
msgid "Select your choice(s) and click "
|
||||
msgstr "Zaznacz swój wybór i kliknij "
|
||||
|
||||
#: contrib/admin/media/js/SelectFilter2.js:59
|
||||
msgid "Clear all"
|
||||
msgstr "Wyczyść wszystko"
|
||||
|
||||
#: contrib/admin/media/js/dateparse.js:26
|
||||
#: contrib/admin/media/js/calendar.js:24
|
||||
msgid ""
|
||||
"January February March April May June July August September October November "
|
||||
"December"
|
||||
msgstr "Styczeń Luty Marzec Kwiecień Maj Czerwiec Lipiec Sierpień Wrzesień Październik Listopad Grudzień"
|
||||
|
||||
#: contrib/admin/media/js/dateparse.js:27
|
||||
msgid "Sunday Monday Tuesday Wednesday Thursday Friday Saturday"
|
||||
msgstr "Niedziela Poniedziałek Wtorek Środa Czwartek Piątek Sobota"
|
||||
|
||||
#: contrib/admin/media/js/calendar.js:25
|
||||
msgid "S M T W T F S"
|
||||
msgstr "N Pn Wt Śr Cz Pt So"
|
||||
|
||||
#: contrib/admin/media/js/admin/DateTimeShortcuts.js:45
|
||||
#: contrib/admin/media/js/admin/DateTimeShortcuts.js:80
|
||||
msgid "Now"
|
||||
msgstr "Teraz"
|
||||
|
||||
#: contrib/admin/media/js/admin/DateTimeShortcuts.js:48
|
||||
msgid "Clock"
|
||||
msgstr "Zegar"
|
||||
|
||||
#: contrib/admin/media/js/admin/DateTimeShortcuts.js:77
|
||||
msgid "Choose a time"
|
||||
msgstr "Wybierz czas"
|
||||
|
||||
#: contrib/admin/media/js/admin/DateTimeShortcuts.js:81
|
||||
msgid "Midnight"
|
||||
msgstr "Północ"
|
||||
|
||||
#: contrib/admin/media/js/admin/DateTimeShortcuts.js:82
|
||||
msgid "6 a.m."
|
||||
msgstr "6 rano"
|
||||
|
||||
#: contrib/admin/media/js/admin/DateTimeShortcuts.js:83
|
||||
msgid "Noon"
|
||||
msgstr "Południe"
|
||||
|
||||
#: contrib/admin/media/js/admin/DateTimeShortcuts.js:87
|
||||
#: contrib/admin/media/js/admin/DateTimeShortcuts.js:168
|
||||
msgid "Cancel"
|
||||
msgstr "Anuluj"
|
||||
|
||||
#: contrib/admin/media/js/admin/DateTimeShortcuts.js:111
|
||||
#: contrib/admin/media/js/admin/DateTimeShortcuts.js:162
|
||||
msgid "Today"
|
||||
msgstr "Dzisiaj"
|
||||
|
||||
#: contrib/admin/media/js/admin/DateTimeShortcuts.js:114
|
||||
msgid "Calendar"
|
||||
msgstr "Kalendarz"
|
||||
|
||||
#: contrib/admin/media/js/admin/DateTimeShortcuts.js:160
|
||||
msgid "Yesterday"
|
||||
msgstr "Wczoraj"
|
||||
|
||||
#: contrib/admin/media/js/admin/DateTimeShortcuts.js:164
|
||||
msgid "Tomorrow"
|
||||
msgstr "Jutro"
|
||||
|
BIN
django/conf/locale/pt/LC_MESSAGES/django.mo
Normal file
BIN
django/conf/locale/pt/LC_MESSAGES/django.mo
Normal file
Binary file not shown.
2125
django/conf/locale/pt/LC_MESSAGES/django.po
Normal file
2125
django/conf/locale/pt/LC_MESSAGES/django.po
Normal file
File diff suppressed because it is too large
Load Diff
BIN
django/conf/locale/pt/LC_MESSAGES/djangojs.mo
Normal file
BIN
django/conf/locale/pt/LC_MESSAGES/djangojs.mo
Normal file
Binary file not shown.
108
django/conf/locale/pt/LC_MESSAGES/djangojs.po
Normal file
108
django/conf/locale/pt/LC_MESSAGES/djangojs.po
Normal file
@ -0,0 +1,108 @@
|
||||
# Portuguese translation of Django.
|
||||
# Copyright (C) 2007 the Lawrence Journal-World
|
||||
# This file is distributed under the same license as the PACKAGE package.
|
||||
# Nuno Mariz <nmariz@gmail.com>, 2007.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Django 0.96pre\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2007-03-15 11:51+0100\n"
|
||||
"PO-Revision-Date: 2007-03-16 10:01+0000\n"
|
||||
"Last-Translator: Nuno Mariz <nmariz@gmail.com>\n"
|
||||
"Language-Team: pt_PT <nmariz@gmail.com>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=utf-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
||||
#: contrib/admin/media/js/SelectFilter2.js:33
|
||||
#, perl-format
|
||||
msgid "Available %s"
|
||||
msgstr "Disponível %s"
|
||||
|
||||
#: contrib/admin/media/js/SelectFilter2.js:41
|
||||
msgid "Choose all"
|
||||
msgstr "Escolher todos"
|
||||
|
||||
#: contrib/admin/media/js/SelectFilter2.js:46
|
||||
msgid "Add"
|
||||
msgstr "Adicionar"
|
||||
|
||||
#: contrib/admin/media/js/SelectFilter2.js:48
|
||||
msgid "Remove"
|
||||
msgstr "Remover"
|
||||
|
||||
#: contrib/admin/media/js/SelectFilter2.js:53
|
||||
#, perl-format
|
||||
msgid "Chosen %s"
|
||||
msgstr "Escolhido %s"
|
||||
|
||||
#: contrib/admin/media/js/SelectFilter2.js:54
|
||||
msgid "Select your choice(s) and click "
|
||||
msgstr "Seleccione a(s) sua(s) escolha(s) e clique "
|
||||
|
||||
#: contrib/admin/media/js/SelectFilter2.js:59
|
||||
msgid "Clear all"
|
||||
msgstr "Limpar tudo"
|
||||
|
||||
#: contrib/admin/media/js/dateparse.js:26
|
||||
#: contrib/admin/media/js/calendar.js:24
|
||||
msgid ""
|
||||
"January February March April May June July August September October November "
|
||||
"December"
|
||||
msgstr "Janeiro Fevereiro Março Abril Maio Junho Julho Agosto Setembro Outubro Novembro Dezembro"
|
||||
|
||||
#: contrib/admin/media/js/dateparse.js:27
|
||||
msgid "Sunday Monday Tuesday Wednesday Thursday Friday Saturday"
|
||||
msgstr "Domingo Segunda Terça Quarta Quinta Sexta Sábado"
|
||||
|
||||
#: contrib/admin/media/js/calendar.js:25
|
||||
msgid "S M T W T F S"
|
||||
msgstr "D S T Q Q S S"
|
||||
|
||||
#: contrib/admin/media/js/admin/DateTimeShortcuts.js:45
|
||||
#: contrib/admin/media/js/admin/DateTimeShortcuts.js:80
|
||||
msgid "Now"
|
||||
msgstr "Agora"
|
||||
|
||||
#: contrib/admin/media/js/admin/DateTimeShortcuts.js:48
|
||||
msgid "Clock"
|
||||
msgstr "Relógio"
|
||||
|
||||
#: contrib/admin/media/js/admin/DateTimeShortcuts.js:77
|
||||
msgid "Choose a time"
|
||||
msgstr "Escolha a hora"
|
||||
|
||||
#: contrib/admin/media/js/admin/DateTimeShortcuts.js:81
|
||||
msgid "Midnight"
|
||||
msgstr "Meia-noite"
|
||||
|
||||
#: contrib/admin/media/js/admin/DateTimeShortcuts.js:82
|
||||
msgid "6 a.m."
|
||||
msgstr "6 a.m."
|
||||
|
||||
#: contrib/admin/media/js/admin/DateTimeShortcuts.js:83
|
||||
msgid "Noon"
|
||||
msgstr "Meio-dia"
|
||||
|
||||
#: contrib/admin/media/js/admin/DateTimeShortcuts.js:87
|
||||
#: contrib/admin/media/js/admin/DateTimeShortcuts.js:168
|
||||
msgid "Cancel"
|
||||
msgstr "Cancelar"
|
||||
|
||||
#: contrib/admin/media/js/admin/DateTimeShortcuts.js:111
|
||||
#: contrib/admin/media/js/admin/DateTimeShortcuts.js:162
|
||||
msgid "Today"
|
||||
msgstr "Hoje"
|
||||
|
||||
#: contrib/admin/media/js/admin/DateTimeShortcuts.js:114
|
||||
msgid "Calendar"
|
||||
msgstr "Calendário"
|
||||
|
||||
#: contrib/admin/media/js/admin/DateTimeShortcuts.js:160
|
||||
msgid "Yesterday"
|
||||
msgstr "Ontem"
|
||||
|
||||
#: contrib/admin/media/js/admin/DateTimeShortcuts.js:164
|
||||
msgid "Tomorrow"
|
||||
msgstr "Amanhã"
|
Binary file not shown.
File diff suppressed because it is too large
Load Diff
BIN
django/conf/locale/ta/LC_MESSAGES/djangojs.mo
Normal file
BIN
django/conf/locale/ta/LC_MESSAGES/djangojs.mo
Normal file
Binary file not shown.
112
django/conf/locale/ta/LC_MESSAGES/djangojs.po
Normal file
112
django/conf/locale/ta/LC_MESSAGES/djangojs.po
Normal file
@ -0,0 +1,112 @@
|
||||
# translation of djangojs.po to tamil
|
||||
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
||||
# This file is distributed under the same license as the PACKAGE package.
|
||||
#
|
||||
# PONNUSAMY.A <ponnusamy.simpleman@gmail.com>, 2007.
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: djangojs\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2007-12-09 11:51+0100\n"
|
||||
"PO-Revision-Date: 2007-03-14 16:40+0530\n"
|
||||
"Last-Translator: PONNUSAMY <ponnusamy.simpleman@gmail.com>\n"
|
||||
"Language-Team: tamil <tamilinix@yahoogroups.com>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Generator: KBabel 1.11.4\n"
|
||||
|
||||
#: contrib/admin/media/js/SelectFilter2.js:33
|
||||
#, perl-format
|
||||
msgid "Available %s"
|
||||
msgstr "%s இருக்கிறதா "
|
||||
|
||||
#: contrib/admin/media/js/SelectFilter2.js:41
|
||||
msgid "Choose all"
|
||||
msgstr "எல்லாவற்றையும் தேர்ந்த்தெடுக்க"
|
||||
|
||||
#: contrib/admin/media/js/SelectFilter2.js:46
|
||||
msgid "Add"
|
||||
msgstr "சேர்க்க"
|
||||
|
||||
#: contrib/admin/media/js/SelectFilter2.js:48
|
||||
msgid "Remove"
|
||||
msgstr "அழிக்க"
|
||||
|
||||
#: contrib/admin/media/js/SelectFilter2.js:53
|
||||
#, perl-format
|
||||
msgid "Chosen %s"
|
||||
msgstr "%s தேர்ந்த்தெடுக்கப்பட்ட"
|
||||
|
||||
#: contrib/admin/media/js/SelectFilter2.js:54
|
||||
msgid "Select your choice(s) and click "
|
||||
msgstr "தேவையானவற்றை தேர்ந்த்தெடுத்து கிளிக் செய்க"
|
||||
|
||||
#: contrib/admin/media/js/SelectFilter2.js:59
|
||||
msgid "Clear all"
|
||||
msgstr "எல்லாவற்றையும் அழிக்க "
|
||||
|
||||
#: contrib/admin/media/js/dateparse.js:26
|
||||
#: contrib/admin/media/js/calendar.js:24
|
||||
msgid ""
|
||||
"January February March April May June July August September October November "
|
||||
"December"
|
||||
msgstr ""
|
||||
"ஜனவரி பிப்ரவரி மார்ச் ஏப்ரல் மே ஜூன் ஜூலை ஆகஸ்டு செப்டம்பர் அக்டோபர் நவம்பர் "
|
||||
"டிசம்பர்"
|
||||
|
||||
#: contrib/admin/media/js/dateparse.js:27
|
||||
msgid "Sunday Monday Tuesday Wednesday Thursday Friday Saturday"
|
||||
msgstr "ஞாயிறு திங்கள் செவ்வாய் புதன் வியாழன் வெள்ளி சனி "
|
||||
|
||||
#: contrib/admin/media/js/calendar.js:25
|
||||
msgid "S M T W T F S"
|
||||
msgstr "ஞா தி செ பு வி வெ ச"
|
||||
|
||||
#: contrib/admin/media/js/admin/DateTimeShortcuts.js:45
|
||||
#: contrib/admin/media/js/admin/DateTimeShortcuts.js:80
|
||||
msgid "Now"
|
||||
msgstr "இப்பொழுது "
|
||||
|
||||
#: contrib/admin/media/js/admin/DateTimeShortcuts.js:48
|
||||
msgid "Clock"
|
||||
msgstr "கடிகாரம் "
|
||||
|
||||
#: contrib/admin/media/js/admin/DateTimeShortcuts.js:77
|
||||
msgid "Choose a time"
|
||||
msgstr "ஒரு நேரத்தை தேர்ந்த்தெடுக்க "
|
||||
|
||||
#: contrib/admin/media/js/admin/DateTimeShortcuts.js:81
|
||||
msgid "Midnight"
|
||||
msgstr "நடு இரவு "
|
||||
|
||||
#: contrib/admin/media/js/admin/DateTimeShortcuts.js:82
|
||||
msgid "6 a.m."
|
||||
msgstr "காலை 6 மணி "
|
||||
|
||||
#: contrib/admin/media/js/admin/DateTimeShortcuts.js:83
|
||||
msgid "Noon"
|
||||
msgstr "மதியம் "
|
||||
|
||||
#: contrib/admin/media/js/admin/DateTimeShortcuts.js:87
|
||||
#: contrib/admin/media/js/admin/DateTimeShortcuts.js:168
|
||||
msgid "Cancel"
|
||||
msgstr "வேண்டாம் "
|
||||
|
||||
#: contrib/admin/media/js/admin/DateTimeShortcuts.js:111
|
||||
#: contrib/admin/media/js/admin/DateTimeShortcuts.js:162
|
||||
msgid "Today"
|
||||
msgstr "இன்று "
|
||||
|
||||
#: contrib/admin/media/js/admin/DateTimeShortcuts.js:114
|
||||
msgid "Calendar"
|
||||
msgstr "நாள்காட்டி "
|
||||
|
||||
#: contrib/admin/media/js/admin/DateTimeShortcuts.js:160
|
||||
msgid "Yesterday"
|
||||
msgstr "நேற்று "
|
||||
|
||||
#: contrib/admin/media/js/admin/DateTimeShortcuts.js:164
|
||||
msgid "Tomorrow"
|
||||
msgstr "நாளை"
|
||||
|
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@ -9,7 +9,7 @@
|
||||
{{ form }}
|
||||
</table>
|
||||
<input type="hidden" name="{{ stage_field }}" value="1" />
|
||||
<p><input type="submit" value="Submit" /></p>
|
||||
<p><input type="submit" value="Preview" /></p>
|
||||
</form>
|
||||
|
||||
{% endblock %}
|
||||
|
@ -7,7 +7,7 @@
|
||||
<table>
|
||||
{% for field in form %}
|
||||
<tr>
|
||||
<th>{{ field.verbose_name }}:</th>
|
||||
<th>{{ field.label }}:</th>
|
||||
<td>{{ field.data|escape }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
@ -30,7 +30,7 @@
|
||||
{{ form }}
|
||||
</table>
|
||||
<input type="hidden" name="{{ stage_field }}" value="1" />
|
||||
<p><input type="submit" value="Submit changes" /></p>
|
||||
<p><input type="submit" value="Preview" /></p>
|
||||
</form>
|
||||
|
||||
{% endblock %}
|
||||
|
@ -83,7 +83,12 @@ class SessionMiddleware(object):
|
||||
if accessed:
|
||||
patch_vary_headers(response, ('Cookie',))
|
||||
if modified or settings.SESSION_SAVE_EVERY_REQUEST:
|
||||
session_key = request.session.session_key or Session.objects.get_new_session_key()
|
||||
if request.session.session_key:
|
||||
session_key = request.session.session_key
|
||||
else:
|
||||
obj = Session.objects.get_new_session_object()
|
||||
session_key = obj.session_key
|
||||
|
||||
if settings.SESSION_EXPIRE_AT_BROWSER_CLOSE:
|
||||
max_age = None
|
||||
expires = None
|
||||
|
@ -1,4 +1,4 @@
|
||||
import base64, md5, random, sys
|
||||
import base64, md5, random, sys, datetime
|
||||
import cPickle as pickle
|
||||
from django.db import models
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
@ -23,6 +23,23 @@ class SessionManager(models.Manager):
|
||||
break
|
||||
return session_key
|
||||
|
||||
def get_new_session_object(self):
|
||||
"""
|
||||
Returns a new session object.
|
||||
"""
|
||||
# FIXME: There is a *small* chance of collision here, meaning we will
|
||||
# return an existing object. That can be fixed when we add a way to
|
||||
# validate (and guarantee) that non-auto primary keys are unique. For
|
||||
# now, we save immediately in order to reduce the "window of
|
||||
# misfortune" as much as possible.
|
||||
created = False
|
||||
while not created:
|
||||
obj, created = self.get_or_create(session_key=self.get_new_session_key(),
|
||||
expire_date = datetime.datetime.now())
|
||||
# Collision in key generation, so re-seed the generator
|
||||
random.seed()
|
||||
return obj
|
||||
|
||||
def save(self, session_key, session_dict, expire_date):
|
||||
s = self.model(session_key, self.encode(session_dict), expire_date)
|
||||
if session_dict:
|
||||
|
@ -80,6 +80,8 @@ class DatabaseWrapper(local):
|
||||
if not self._valid_connection():
|
||||
kwargs = {
|
||||
'conv': django_conversions,
|
||||
'charset': 'utf8',
|
||||
'use_unicode': False,
|
||||
}
|
||||
if settings.DATABASE_USER:
|
||||
kwargs['user'] = settings.DATABASE_USER
|
||||
|
0
django/db/backends/mysql_old/__init__.py
Normal file
0
django/db/backends/mysql_old/__init__.py
Normal file
233
django/db/backends/mysql_old/base.py
Normal file
233
django/db/backends/mysql_old/base.py
Normal file
@ -0,0 +1,233 @@
|
||||
"""
|
||||
MySQL database backend for Django.
|
||||
|
||||
Requires MySQLdb: http://sourceforge.net/projects/mysql-python
|
||||
"""
|
||||
|
||||
from django.db.backends import util
|
||||
try:
|
||||
import MySQLdb as Database
|
||||
except ImportError, e:
|
||||
from django.core.exceptions import ImproperlyConfigured
|
||||
raise ImproperlyConfigured, "Error loading MySQLdb module: %s" % e
|
||||
from MySQLdb.converters import conversions
|
||||
from MySQLdb.constants import FIELD_TYPE
|
||||
import types
|
||||
import re
|
||||
|
||||
DatabaseError = Database.DatabaseError
|
||||
|
||||
django_conversions = conversions.copy()
|
||||
django_conversions.update({
|
||||
types.BooleanType: util.rev_typecast_boolean,
|
||||
FIELD_TYPE.DATETIME: util.typecast_timestamp,
|
||||
FIELD_TYPE.DATE: util.typecast_date,
|
||||
FIELD_TYPE.TIME: util.typecast_time,
|
||||
})
|
||||
|
||||
# This should match the numerical portion of the version numbers (we can treat
|
||||
# versions like 5.0.24 and 5.0.24a as the same). Based on the list of version
|
||||
# at http://dev.mysql.com/doc/refman/4.1/en/news.html and
|
||||
# http://dev.mysql.com/doc/refman/5.0/en/news.html .
|
||||
server_version_re = re.compile(r'(\d{1,2})\.(\d{1,2})\.(\d{1,2})')
|
||||
|
||||
# This is an extra debug layer over MySQL queries, to display warnings.
|
||||
# It's only used when DEBUG=True.
|
||||
class MysqlDebugWrapper:
|
||||
def __init__(self, cursor):
|
||||
self.cursor = cursor
|
||||
|
||||
def execute(self, sql, params=()):
|
||||
try:
|
||||
return self.cursor.execute(sql, params)
|
||||
except Database.Warning, w:
|
||||
self.cursor.execute("SHOW WARNINGS")
|
||||
raise Database.Warning, "%s: %s" % (w, self.cursor.fetchall())
|
||||
|
||||
def executemany(self, sql, param_list):
|
||||
try:
|
||||
return self.cursor.executemany(sql, param_list)
|
||||
except Database.Warning, w:
|
||||
self.cursor.execute("SHOW WARNINGS")
|
||||
raise Database.Warning, "%s: %s" % (w, self.cursor.fetchall())
|
||||
|
||||
def __getattr__(self, attr):
|
||||
if self.__dict__.has_key(attr):
|
||||
return self.__dict__[attr]
|
||||
else:
|
||||
return getattr(self.cursor, attr)
|
||||
|
||||
try:
|
||||
# Only exists in Python 2.4+
|
||||
from threading import local
|
||||
except ImportError:
|
||||
# Import copy of _thread_local.py from Python 2.4
|
||||
from django.utils._threading_local import local
|
||||
|
||||
class DatabaseWrapper(local):
|
||||
def __init__(self, **kwargs):
|
||||
self.connection = None
|
||||
self.queries = []
|
||||
self.server_version = None
|
||||
self.options = kwargs
|
||||
|
||||
def _valid_connection(self):
|
||||
if self.connection is not None:
|
||||
try:
|
||||
self.connection.ping()
|
||||
return True
|
||||
except DatabaseError:
|
||||
self.connection.close()
|
||||
self.connection = None
|
||||
return False
|
||||
|
||||
def cursor(self):
|
||||
from django.conf import settings
|
||||
if not self._valid_connection():
|
||||
kwargs = {
|
||||
'user': settings.DATABASE_USER,
|
||||
'db': settings.DATABASE_NAME,
|
||||
'passwd': settings.DATABASE_PASSWORD,
|
||||
'conv': django_conversions,
|
||||
}
|
||||
if settings.DATABASE_HOST.startswith('/'):
|
||||
kwargs['unix_socket'] = settings.DATABASE_HOST
|
||||
else:
|
||||
kwargs['host'] = settings.DATABASE_HOST
|
||||
if settings.DATABASE_PORT:
|
||||
kwargs['port'] = int(settings.DATABASE_PORT)
|
||||
kwargs.update(self.options)
|
||||
self.connection = Database.connect(**kwargs)
|
||||
cursor = self.connection.cursor()
|
||||
if self.connection.get_server_info() >= '4.1':
|
||||
cursor.execute("SET NAMES 'utf8'")
|
||||
else:
|
||||
cursor = self.connection.cursor()
|
||||
if settings.DEBUG:
|
||||
return util.CursorDebugWrapper(MysqlDebugWrapper(cursor), self)
|
||||
return cursor
|
||||
|
||||
def _commit(self):
|
||||
if self.connection is not None:
|
||||
self.connection.commit()
|
||||
|
||||
def _rollback(self):
|
||||
if self.connection is not None:
|
||||
try:
|
||||
self.connection.rollback()
|
||||
except Database.NotSupportedError:
|
||||
pass
|
||||
|
||||
def close(self):
|
||||
if self.connection is not None:
|
||||
self.connection.close()
|
||||
self.connection = None
|
||||
|
||||
def get_server_version(self):
|
||||
if not self.server_version:
|
||||
if not self._valid_connection():
|
||||
self.cursor()
|
||||
m = server_version_re.match(self.connection.get_server_info())
|
||||
if not m:
|
||||
raise Exception('Unable to determine MySQL version from version string %r' % self.connection.get_server_info())
|
||||
self.server_version = tuple([int(x) for x in m.groups()])
|
||||
return self.server_version
|
||||
|
||||
supports_constraints = True
|
||||
|
||||
def quote_name(name):
|
||||
if name.startswith("`") and name.endswith("`"):
|
||||
return name # Quoting once is enough.
|
||||
return "`%s`" % name
|
||||
|
||||
dictfetchone = util.dictfetchone
|
||||
dictfetchmany = util.dictfetchmany
|
||||
dictfetchall = util.dictfetchall
|
||||
|
||||
def get_last_insert_id(cursor, table_name, pk_name):
|
||||
return cursor.lastrowid
|
||||
|
||||
def get_date_extract_sql(lookup_type, table_name):
|
||||
# lookup_type is 'year', 'month', 'day'
|
||||
# http://dev.mysql.com/doc/mysql/en/date-and-time-functions.html
|
||||
return "EXTRACT(%s FROM %s)" % (lookup_type.upper(), table_name)
|
||||
|
||||
def get_date_trunc_sql(lookup_type, field_name):
|
||||
# lookup_type is 'year', 'month', 'day'
|
||||
fields = ['year', 'month', 'day', 'hour', 'minute', 'second']
|
||||
format = ('%%Y-', '%%m', '-%%d', ' %%H:', '%%i', ':%%s') # Use double percents to escape.
|
||||
format_def = ('0000-', '01', '-01', ' 00:', '00', ':00')
|
||||
try:
|
||||
i = fields.index(lookup_type) + 1
|
||||
except ValueError:
|
||||
sql = field_name
|
||||
else:
|
||||
format_str = ''.join([f for f in format[:i]] + [f for f in format_def[i:]])
|
||||
sql = "CAST(DATE_FORMAT(%s, '%s') AS DATETIME)" % (field_name, format_str)
|
||||
return sql
|
||||
|
||||
def get_limit_offset_sql(limit, offset=None):
|
||||
sql = "LIMIT "
|
||||
if offset and offset != 0:
|
||||
sql += "%s," % offset
|
||||
return sql + str(limit)
|
||||
|
||||
def get_random_function_sql():
|
||||
return "RAND()"
|
||||
|
||||
def get_deferrable_sql():
|
||||
return ""
|
||||
|
||||
def get_fulltext_search_sql(field_name):
|
||||
return 'MATCH (%s) AGAINST (%%s IN BOOLEAN MODE)' % field_name
|
||||
|
||||
def get_drop_foreignkey_sql():
|
||||
return "DROP FOREIGN KEY"
|
||||
|
||||
def get_pk_default_value():
|
||||
return "DEFAULT"
|
||||
|
||||
def get_sql_flush(style, tables, sequences):
|
||||
"""Return a list of SQL statements required to remove all data from
|
||||
all tables in the database (without actually removing the tables
|
||||
themselves) and put the database in an empty 'initial' state
|
||||
|
||||
"""
|
||||
# NB: The generated SQL below is specific to MySQL
|
||||
# 'TRUNCATE x;', 'TRUNCATE y;', 'TRUNCATE z;'... style SQL statements
|
||||
# to clear all tables of all data
|
||||
if tables:
|
||||
sql = ['SET FOREIGN_KEY_CHECKS = 0;'] + \
|
||||
['%s %s;' % \
|
||||
(style.SQL_KEYWORD('TRUNCATE'),
|
||||
style.SQL_FIELD(quote_name(table))
|
||||
) for table in tables] + \
|
||||
['SET FOREIGN_KEY_CHECKS = 1;']
|
||||
|
||||
# 'ALTER TABLE table AUTO_INCREMENT = 1;'... style SQL statements
|
||||
# to reset sequence indices
|
||||
sql.extend(["%s %s %s %s %s;" % \
|
||||
(style.SQL_KEYWORD('ALTER'),
|
||||
style.SQL_KEYWORD('TABLE'),
|
||||
style.SQL_TABLE(quote_name(sequence['table'])),
|
||||
style.SQL_KEYWORD('AUTO_INCREMENT'),
|
||||
style.SQL_FIELD('= 1'),
|
||||
) for sequence in sequences])
|
||||
return sql
|
||||
else:
|
||||
return []
|
||||
|
||||
OPERATOR_MAPPING = {
|
||||
'exact': '= %s',
|
||||
'iexact': 'LIKE %s',
|
||||
'contains': 'LIKE BINARY %s',
|
||||
'icontains': 'LIKE %s',
|
||||
'gt': '> %s',
|
||||
'gte': '>= %s',
|
||||
'lt': '< %s',
|
||||
'lte': '<= %s',
|
||||
'startswith': 'LIKE BINARY %s',
|
||||
'endswith': 'LIKE BINARY %s',
|
||||
'istartswith': 'LIKE %s',
|
||||
'iendswith': 'LIKE %s',
|
||||
}
|
14
django/db/backends/mysql_old/client.py
Normal file
14
django/db/backends/mysql_old/client.py
Normal file
@ -0,0 +1,14 @@
|
||||
from django.conf import settings
|
||||
import os
|
||||
|
||||
def runshell():
|
||||
args = ['']
|
||||
args += ["--user=%s" % settings.DATABASE_USER]
|
||||
if settings.DATABASE_PASSWORD:
|
||||
args += ["--password=%s" % settings.DATABASE_PASSWORD]
|
||||
if settings.DATABASE_HOST:
|
||||
args += ["--host=%s" % settings.DATABASE_HOST]
|
||||
if settings.DATABASE_PORT:
|
||||
args += ["--port=%s" % settings.DATABASE_PORT]
|
||||
args += [settings.DATABASE_NAME]
|
||||
os.execvp('mysql', args)
|
29
django/db/backends/mysql_old/creation.py
Normal file
29
django/db/backends/mysql_old/creation.py
Normal file
@ -0,0 +1,29 @@
|
||||
# This dictionary maps Field objects to their associated MySQL column
|
||||
# types, as strings. Column-type strings can contain format strings; they'll
|
||||
# be interpolated against the values of Field.__dict__ before being output.
|
||||
# If a column type is set to None, it won't be included in the output.
|
||||
DATA_TYPES = {
|
||||
'AutoField': 'integer AUTO_INCREMENT',
|
||||
'BooleanField': 'bool',
|
||||
'CharField': 'varchar(%(maxlength)s)',
|
||||
'CommaSeparatedIntegerField': 'varchar(%(maxlength)s)',
|
||||
'DateField': 'date',
|
||||
'DateTimeField': 'datetime',
|
||||
'FileField': 'varchar(100)',
|
||||
'FilePathField': 'varchar(100)',
|
||||
'FloatField': 'numeric(%(max_digits)s, %(decimal_places)s)',
|
||||
'ImageField': 'varchar(100)',
|
||||
'IntegerField': 'integer',
|
||||
'IPAddressField': 'char(15)',
|
||||
'ManyToManyField': None,
|
||||
'NullBooleanField': 'bool',
|
||||
'OneToOneField': 'integer',
|
||||
'PhoneNumberField': 'varchar(20)',
|
||||
'PositiveIntegerField': 'integer UNSIGNED',
|
||||
'PositiveSmallIntegerField': 'smallint UNSIGNED',
|
||||
'SlugField': 'varchar(%(maxlength)s)',
|
||||
'SmallIntegerField': 'smallint',
|
||||
'TextField': 'longtext',
|
||||
'TimeField': 'time',
|
||||
'USStateField': 'varchar(2)',
|
||||
}
|
95
django/db/backends/mysql_old/introspection.py
Normal file
95
django/db/backends/mysql_old/introspection.py
Normal file
@ -0,0 +1,95 @@
|
||||
from django.db.backends.mysql_old.base import quote_name
|
||||
from MySQLdb import ProgrammingError, OperationalError
|
||||
from MySQLdb.constants import FIELD_TYPE
|
||||
import re
|
||||
|
||||
foreign_key_re = re.compile(r"\sCONSTRAINT `[^`]*` FOREIGN KEY \(`([^`]*)`\) REFERENCES `([^`]*)` \(`([^`]*)`\)")
|
||||
|
||||
def get_table_list(cursor):
|
||||
"Returns a list of table names in the current database."
|
||||
cursor.execute("SHOW TABLES")
|
||||
return [row[0] for row in cursor.fetchall()]
|
||||
|
||||
def get_table_description(cursor, table_name):
|
||||
"Returns a description of the table, with the DB-API cursor.description interface."
|
||||
cursor.execute("SELECT * FROM %s LIMIT 1" % quote_name(table_name))
|
||||
return cursor.description
|
||||
|
||||
def _name_to_index(cursor, table_name):
|
||||
"""
|
||||
Returns a dictionary of {field_name: field_index} for the given table.
|
||||
Indexes are 0-based.
|
||||
"""
|
||||
return dict([(d[0], i) for i, d in enumerate(get_table_description(cursor, table_name))])
|
||||
|
||||
def get_relations(cursor, table_name):
|
||||
"""
|
||||
Returns a dictionary of {field_index: (field_index_other_table, other_table)}
|
||||
representing all relationships to the given table. Indexes are 0-based.
|
||||
"""
|
||||
my_field_dict = _name_to_index(cursor, table_name)
|
||||
constraints = []
|
||||
relations = {}
|
||||
try:
|
||||
# This should work for MySQL 5.0.
|
||||
cursor.execute("""
|
||||
SELECT column_name, referenced_table_name, referenced_column_name
|
||||
FROM information_schema.key_column_usage
|
||||
WHERE table_name = %s
|
||||
AND table_schema = DATABASE()
|
||||
AND referenced_table_name IS NOT NULL
|
||||
AND referenced_column_name IS NOT NULL""", [table_name])
|
||||
constraints.extend(cursor.fetchall())
|
||||
except (ProgrammingError, OperationalError):
|
||||
# Fall back to "SHOW CREATE TABLE", for previous MySQL versions.
|
||||
# Go through all constraints and save the equal matches.
|
||||
cursor.execute("SHOW CREATE TABLE %s" % quote_name(table_name))
|
||||
for row in cursor.fetchall():
|
||||
pos = 0
|
||||
while True:
|
||||
match = foreign_key_re.search(row[1], pos)
|
||||
if match == None:
|
||||
break
|
||||
pos = match.end()
|
||||
constraints.append(match.groups())
|
||||
|
||||
for my_fieldname, other_table, other_field in constraints:
|
||||
other_field_index = _name_to_index(cursor, other_table)[other_field]
|
||||
my_field_index = my_field_dict[my_fieldname]
|
||||
relations[my_field_index] = (other_field_index, other_table)
|
||||
|
||||
return relations
|
||||
|
||||
def get_indexes(cursor, table_name):
|
||||
"""
|
||||
Returns a dictionary of fieldname -> infodict for the given table,
|
||||
where each infodict is in the format:
|
||||
{'primary_key': boolean representing whether it's the primary key,
|
||||
'unique': boolean representing whether it's a unique index}
|
||||
"""
|
||||
cursor.execute("SHOW INDEX FROM %s" % quote_name(table_name))
|
||||
indexes = {}
|
||||
for row in cursor.fetchall():
|
||||
indexes[row[4]] = {'primary_key': (row[2] == 'PRIMARY'), 'unique': not bool(row[1])}
|
||||
return indexes
|
||||
|
||||
DATA_TYPES_REVERSE = {
|
||||
FIELD_TYPE.BLOB: 'TextField',
|
||||
FIELD_TYPE.CHAR: 'CharField',
|
||||
FIELD_TYPE.DECIMAL: 'FloatField',
|
||||
FIELD_TYPE.DATE: 'DateField',
|
||||
FIELD_TYPE.DATETIME: 'DateTimeField',
|
||||
FIELD_TYPE.DOUBLE: 'FloatField',
|
||||
FIELD_TYPE.FLOAT: 'FloatField',
|
||||
FIELD_TYPE.INT24: 'IntegerField',
|
||||
FIELD_TYPE.LONG: 'IntegerField',
|
||||
FIELD_TYPE.LONGLONG: 'IntegerField',
|
||||
FIELD_TYPE.SHORT: 'IntegerField',
|
||||
FIELD_TYPE.STRING: 'TextField',
|
||||
FIELD_TYPE.TIMESTAMP: 'DateTimeField',
|
||||
FIELD_TYPE.TINY: 'IntegerField',
|
||||
FIELD_TYPE.TINY_BLOB: 'TextField',
|
||||
FIELD_TYPE.MEDIUM_BLOB: 'TextField',
|
||||
FIELD_TYPE.LONG_BLOB: 'TextField',
|
||||
FIELD_TYPE.VAR_STRING: 'CharField',
|
||||
}
|
@ -109,6 +109,8 @@ class _QuerySet(object):
|
||||
|
||||
def __getitem__(self, k):
|
||||
"Retrieve an item or slice from the set of results."
|
||||
if not isinstance(k, (slice, int)):
|
||||
raise TypeError
|
||||
assert (not isinstance(k, slice) and (k >= 0)) \
|
||||
or (isinstance(k, slice) and (k.start is None or k.start >= 0) and (k.stop is None or k.stop >= 0)), \
|
||||
"Negative indexing is not supported."
|
||||
|
@ -19,7 +19,7 @@ def get_object_or_404(klass, *args, **kwargs):
|
||||
try:
|
||||
return manager.get(*args, **kwargs)
|
||||
except klass.DoesNotExist:
|
||||
raise Http404
|
||||
raise Http404('No %s matches the given query.' % klass._meta.object_name)
|
||||
|
||||
def get_list_or_404(klass, *args, **kwargs):
|
||||
if isinstance(klass, Manager):
|
||||
@ -28,5 +28,5 @@ def get_list_or_404(klass, *args, **kwargs):
|
||||
manager = klass._default_manager
|
||||
obj_list = list(manager.filter(*args, **kwargs))
|
||||
if not obj_list:
|
||||
raise Http404
|
||||
raise Http404('No %s matches the given query.' % manager.model._meta.object_name)
|
||||
return obj_list
|
||||
|
@ -69,6 +69,14 @@ def encode_multipart(boundary, data):
|
||||
'',
|
||||
value.read()
|
||||
])
|
||||
elif hasattr(value, '__iter__'):
|
||||
for item in value:
|
||||
lines.extend([
|
||||
'--' + boundary,
|
||||
'Content-Disposition: form-data; name="%s"' % key,
|
||||
'',
|
||||
str(item)
|
||||
])
|
||||
else:
|
||||
lines.extend([
|
||||
'--' + boundary,
|
||||
|
@ -1,6 +1,6 @@
|
||||
=====================
|
||||
The "contrib" add-ons
|
||||
=====================
|
||||
============================
|
||||
The "django.contrib" add-ons
|
||||
============================
|
||||
|
||||
Django aims to follow Python's `"batteries included" philosophy`_. It ships
|
||||
with a variety of extra, optional tools that solve common Web-development
|
||||
@ -153,12 +153,16 @@ markup
|
||||
|
||||
A collection of template filters that implement these common markup languages:
|
||||
|
||||
* Textile
|
||||
* Markdown
|
||||
* ReST (ReStructured Text)
|
||||
* `Textile`_
|
||||
* `Markdown`_
|
||||
* `ReST (ReStructured Text)`_
|
||||
|
||||
For documentation, read the source code in django/contrib/markup/templatetags/markup.py.
|
||||
|
||||
.. _Textile: http://en.wikipedia.org/wiki/Textile_%28markup_language%29
|
||||
.. _Markdown: http://en.wikipedia.org/wiki/Markdown
|
||||
.. _ReST (ReStructured Text): http://en.wikipedia.org/wiki/ReStructuredText
|
||||
|
||||
redirects
|
||||
=========
|
||||
|
||||
|
@ -31,7 +31,8 @@ but it'll almost always be a QuerySet).
|
||||
|
||||
You can also use a serializer object directly::
|
||||
|
||||
xml_serializer = serializers.get_serializer("xml")
|
||||
XMLSerializer = serializers.get_serializer("xml")
|
||||
xml_serializer = XMLSerializer()
|
||||
xml_serializer.serialize(queryset)
|
||||
data = xml_serializer.getvalue()
|
||||
|
||||
|
@ -245,7 +245,8 @@ DATABASE_ENGINE
|
||||
Default: ``''`` (Empty string)
|
||||
|
||||
Which database backend to use. Either ``'postgresql_psycopg2'``,
|
||||
``'postgresql'``, ``'mysql'``, ``'sqlite3'`` or ``'ado_mssql'``.
|
||||
``'postgresql'``, ``'mysql'``, ``'mysql_old'``, ``'sqlite3'`` or
|
||||
``'ado_mssql'``.
|
||||
|
||||
DATABASE_HOST
|
||||
-------------
|
||||
|
@ -44,7 +44,7 @@ __test__ = {'API_TESTS':"""
|
||||
>>> get_object_or_404(Article, title="Foo")
|
||||
Traceback (most recent call last):
|
||||
...
|
||||
Http404
|
||||
Http404: No Article matches the given query.
|
||||
|
||||
# Create an Article.
|
||||
>>> article = Article.objects.create(title="Run away!")
|
||||
@ -63,7 +63,7 @@ Http404
|
||||
>>> get_object_or_404(a.article_set, title__contains="Camelot")
|
||||
Traceback (most recent call last):
|
||||
...
|
||||
Http404
|
||||
Http404: No Article matches the given query.
|
||||
|
||||
# Custom managers can be used too.
|
||||
>>> get_object_or_404(Article.by_a_sir, title="Run away!")
|
||||
@ -77,7 +77,7 @@ Http404
|
||||
>>> get_list_or_404(a.article_set, title__icontains='Shrubbery')
|
||||
Traceback (most recent call last):
|
||||
...
|
||||
Http404
|
||||
Http404: No Article matches the given query.
|
||||
|
||||
# Custom managers can be used too.
|
||||
>>> get_list_or_404(Article.by_a_sir, title__icontains="Run")
|
||||
|
@ -81,7 +81,43 @@ class ClientTest(TestCase):
|
||||
|
||||
# Check that the response was a 302 (redirect)
|
||||
self.assertEqual(response.status_code, 302)
|
||||
|
||||
|
||||
def test_valid_form(self):
|
||||
"POST valid data to a form"
|
||||
post_data = {
|
||||
'text': 'Hello World',
|
||||
'email': 'foo@example.com',
|
||||
'value': 37,
|
||||
'single': 'b',
|
||||
'multi': ('b','c','e')
|
||||
}
|
||||
response = self.client.post('/test_client/form_view/', post_data)
|
||||
self.assertEqual(response.status_code, 200)
|
||||
self.assertEqual(response.template.name, "Valid POST Template")
|
||||
|
||||
def test_incomplete_data_form(self):
|
||||
"POST incomplete data to a form"
|
||||
post_data = {
|
||||
'text': 'Hello World',
|
||||
'value': 37
|
||||
}
|
||||
response = self.client.post('/test_client/form_view/', post_data)
|
||||
self.assertEqual(response.status_code, 200)
|
||||
self.assertEqual(response.template.name, "Invalid POST Template")
|
||||
|
||||
def test_form_error(self):
|
||||
"POST erroneous data to a form"
|
||||
post_data = {
|
||||
'text': 'Hello World',
|
||||
'email': 'not an email address',
|
||||
'value': 37,
|
||||
'single': 'b',
|
||||
'multi': ('b','c','e')
|
||||
}
|
||||
response = self.client.post('/test_client/form_view/', post_data)
|
||||
self.assertEqual(response.status_code, 200)
|
||||
self.assertEqual(response.template.name, "Invalid POST Template")
|
||||
|
||||
def test_unknown_page(self):
|
||||
"GET an invalid URL"
|
||||
response = self.client.get('/test_client/unknown_view/')
|
||||
|
@ -6,6 +6,7 @@ urlpatterns = patterns('',
|
||||
(r'^post_view/$', views.post_view),
|
||||
(r'^raw_post_view/$', views.raw_post_view),
|
||||
(r'^redirect_view/$', views.redirect_view),
|
||||
(r'^form_view/$', views.form_view),
|
||||
(r'^login_protected_view/$', views.login_protected_view),
|
||||
(r'^session_view/$', views.session_view),
|
||||
(r'^broken_view/$', views.broken_view)
|
||||
|
@ -2,6 +2,8 @@ from xml.dom.minidom import parseString
|
||||
from django.template import Context, Template
|
||||
from django.http import HttpResponse, HttpResponseRedirect
|
||||
from django.contrib.auth.decorators import login_required
|
||||
from django.newforms.forms import Form
|
||||
from django.newforms import fields
|
||||
|
||||
def get_view(request):
|
||||
"A simple view that expects a GET request, and returns a rendered template"
|
||||
@ -45,7 +47,39 @@ def raw_post_view(request):
|
||||
def redirect_view(request):
|
||||
"A view that redirects all requests to the GET view"
|
||||
return HttpResponseRedirect('/test_client/get_view/')
|
||||
|
||||
TestChoices = (
|
||||
('a', 'First Choice'),
|
||||
('b', 'Second Choice'),
|
||||
('c', 'Third Choice'),
|
||||
('d', 'Fourth Choice'),
|
||||
('e', 'Fifth Choice')
|
||||
)
|
||||
|
||||
class TestForm(Form):
|
||||
text = fields.CharField()
|
||||
email = fields.EmailField()
|
||||
value = fields.IntegerField()
|
||||
single = fields.ChoiceField(choices=TestChoices)
|
||||
multi = fields.MultipleChoiceField(choices=TestChoices)
|
||||
|
||||
def form_view(request):
|
||||
"A view that tests a simple form"
|
||||
if request.method == 'POST':
|
||||
form = TestForm(request.POST)
|
||||
if form.is_valid():
|
||||
t = Template('Valid POST data.', name='Valid POST Template')
|
||||
c = Context()
|
||||
else:
|
||||
t = Template('Invalid POST data. {{ form.errors }}', name='Invalid POST Template')
|
||||
c = Context({'form': form})
|
||||
else:
|
||||
form = TestForm()
|
||||
t = Template('Viewing base form. {{ form }}.', name='Form GET Template')
|
||||
c = Context({'form': form})
|
||||
|
||||
return HttpResponse(t.render(c))
|
||||
|
||||
def login_protected_view(request):
|
||||
"A simple view that is login protected."
|
||||
t = Template('This is a login protected test. Username is {{ user.username }}.', name='Login Template')
|
||||
|
Loading…
x
Reference in New Issue
Block a user