1
0
mirror of https://github.com/django/django.git synced 2025-07-03 17:29:12 +00:00

gis: Merged revisions 7355-7403 via svnmerge from trunk.

git-svn-id: http://code.djangoproject.com/svn/django/branches/gis@7405 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Justin Bronn 2008-04-07 20:29:36 +00:00
parent 147bd6ac36
commit b0291347db
48 changed files with 11080 additions and 5663 deletions

View File

@ -136,6 +136,7 @@ answer newbie questions, and generally made Django that much better:
Szilveszter Farkas <szilveszter.farkas@gmail.com>
favo@exoweb.net
Dmitri Fedortchenko <zeraien@gmail.com>
Liang Feng <hutuworm@gmail.com>
Bill Fenner <fenner@gmail.com>
Stefane Fermgier <sf@fermigier.com>
Afonso Fernández Nogueira <fonzzo.django@gmail.com>
@ -154,6 +155,7 @@ answer newbie questions, and generally made Django that much better:
martin.glueck@gmail.com
Artyom Gnilov <boobsd@gmail.com>
GomoX <gomo@datafull.com>
Guilherme Mesquita Gondim <semente@taurinus.org>
Mario Gonzalez <gonzalemario@gmail.com>
pradeep.gowda@gmail.com
Simon Greenhill <dev@simon.net.nz>
@ -166,6 +168,7 @@ answer newbie questions, and generally made Django that much better:
Hawkeye
Joe Heck <http://www.rhonabwy.com/wp/>
Joel Heenan <joelh-django@planetjoel.com>
Mikko Hellsing <mikko@sorl.net>
hipertracker@gmail.com
Deryck Hodge <http://www.devurandom.org/>
Brett Hoerner <bretthoerner@bretthoerner.com>
@ -227,6 +230,7 @@ answer newbie questions, and generally made Django that much better:
Waylan Limberg <waylan@gmail.com>
limodou
Philip Lindborg <philip.lindborg@gmail.com>
Daniel Lindsley <polarcowz@gmail.com>
Trey Long <trey@ktrl.com>
msaelices <msaelices@gmail.com>
Matt McClanahan <http://mmcc.cx/>
@ -238,15 +242,13 @@ answer newbie questions, and generally made Django that much better:
Nuno Mariz <nmariz@gmail.com>
Marijn Vriens <marijn@metronomo.cl>
mark@junklight.com
Orestis Markou <orestis@orestis.gr>
Yasushi Masuda <whosaysni@gmail.com>
mattycakes@gmail.com
Jason McBrayer <http://www.carcosa.net/jason/>
mccutchen@gmail.com
michael.mcewan@gmail.com
michal@plovarna.cz
Mikko Hellsing <mikko@sorl.net>
Daniel Lindsley <polarcowz@gmail.com>
Orestis Markou <orestis@orestis.gr>
Slawek Mikula <slawek dot mikula at gmail dot com>
mitakummaa@gmail.com
mmarshall

View File

@ -70,7 +70,7 @@ LANGUAGES = (
('no', gettext_noop('Norwegian')),
('pl', gettext_noop('Polish')),
('pt', gettext_noop('Portugese')),
('pt-br', gettext_noop('Brazilian')),
('pt-br', gettext_noop('Brazilian Portuguese')),
('ro', gettext_noop('Romanian')),
('ru', gettext_noop('Russian')),
('sk', gettext_noop('Slovak')),
@ -114,7 +114,7 @@ SERVER_EMAIL = 'root@localhost'
SEND_BROKEN_LINK_EMAILS = False
# Database connection info.
DATABASE_ENGINE = '' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'ado_mssql'.
DATABASE_ENGINE = '' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
DATABASE_NAME = '' # Or path to database file if using sqlite3.
DATABASE_USER = '' # Not used with sqlite3.
DATABASE_PASSWORD = '' # Not used with sqlite3.
@ -287,7 +287,7 @@ SESSION_COOKIE_PATH = '/' # The path of the sessio
SESSION_SAVE_EVERY_REQUEST = False # Whether to save the session data on every request.
SESSION_EXPIRE_AT_BROWSER_CLOSE = False # Whether sessions expire when a user closes his browser.
SESSION_ENGINE = 'django.contrib.sessions.backends.db' # The module to store session data
SESSION_FILE_PATH = None # Directory to store session files if using the file session module. If set to None the backend will use a sensible default.
SESSION_FILE_PATH = None # Directory to store session files if using the file session module. If None, the backend will use a sensible default.
#########
# CACHE #

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,21 +1,17 @@
# translation of djangojs.po to español
# translation of djangojs.po to
# Catalan translation for the django-admin JS files.
# translation of djangojs.po to catalan
# This file is distributed under the same license as the Django package.
#
# Antoni Aloy <antoni.aloy@trespams.com>, 2007.
msgid ""
msgstr ""
"Project-Id-Version: Django\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2007-05-20 18:25+0200\n"
"PO-Revision-Date: 2008-01-22 19:39+0100\n"
"Last-Translator: Marc Garcia <marc.garcia@accopensys.com>\n"
"Language-Team: español <ca@li.org>\n"
"POT-Creation-Date: 2007-02-15 01:00+0200\n"
"PO-Revision-Date: 2008-03-25 18:54+0100\n"
"Last-Translator: Django Catalan Group <django-cat@googlegroups.com>\n"
"Language-Team: Catalan <ca@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"
"X-Generator: VIM 7.1\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: contrib/admin/media/js/SelectFilter2.js:33

File diff suppressed because it is too large Load Diff

View File

@ -1,14 +1,14 @@
# Spanish translation for the django-admin JS files.
# Copyright (C)
# This file is distributed under the same license as the PACKAGE package.
#
# Copyright (C) 2008, The Django Project
# This file is distributed under the same license as the django package.
msgid ""
msgstr ""
"Project-Id-Version: Django\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2007-07-14 13:47-0500\n"
"PO-Revision-Date: 2007-07-14 13:41-0500\n"
"Last-Translator: Jorge Gajon <gajon@gajon.org>\n"
"POT-Creation-Date: 2005-10-04 00:00+0200\n"
"PO-Revision-Date: 2008-03-30 00:54+0100\n"
"Last-Translator: Django Spanish Group <django-i18n@googlegroups.com>\n"
"Language-Team: Spanish <django-i18n@googlegroups.com>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Django\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2008-02-25 12:45+0100\n"
"POT-Creation-Date: 2008-03-29 20:56+0100\n"
"PO-Revision-Date: 2008-02-25 15:53+0100\n"
"Last-Translator: Łukasz Czyżykowki <lukasz.czyzykowski@gmail.com>\n"
"Language-Team: Polish <pl@li.org>\n"
@ -65,134 +65,142 @@ msgid "Argentinean Spanish"
msgstr "Hiszpański argentyński"
#: conf/global_settings.py:51
msgid "Basque"
msgstr "Baskijski"
#: conf/global_settings.py:52
msgid "Persian"
msgstr "Perski"
#: conf/global_settings.py:52
#: conf/global_settings.py:53
msgid "Finnish"
msgstr "Fiński"
#: conf/global_settings.py:53
#: conf/global_settings.py:54
msgid "French"
msgstr "Francuski"
#: conf/global_settings.py:54
msgid "Gaeilge"
msgstr "Gaelicki"
#: conf/global_settings.py:55
msgid "Irish"
msgstr "Irlandzki"
#: conf/global_settings.py:56
msgid "Galician"
msgstr "Galicyjski"
#: conf/global_settings.py:56
#: conf/global_settings.py:57
msgid "Hungarian"
msgstr "Węgierski"
#: conf/global_settings.py:57
#: conf/global_settings.py:58
msgid "Hebrew"
msgstr "Hebrajski"
#: conf/global_settings.py:58
#: conf/global_settings.py:59
msgid "Croatian"
msgstr "Horwacki"
#: conf/global_settings.py:59
#: conf/global_settings.py:60
msgid "Icelandic"
msgstr "Islandzki"
#: conf/global_settings.py:60
#: conf/global_settings.py:61
msgid "Italian"
msgstr "Włoski"
#: conf/global_settings.py:61
#: conf/global_settings.py:62
msgid "Japanese"
msgstr "Japoński"
#: conf/global_settings.py:62
#: conf/global_settings.py:63
msgid "Georgian"
msgstr "Gruziński"
#: conf/global_settings.py:64
msgid "Korean"
msgstr "Koreański"
#: conf/global_settings.py:63
#: conf/global_settings.py:65
msgid "Khmer"
msgstr "Khmerski"
#: conf/global_settings.py:64
#: conf/global_settings.py:66
msgid "Kannada"
msgstr "Kannada"
#: conf/global_settings.py:65
#: conf/global_settings.py:67
msgid "Latvian"
msgstr "Łotewski"
#: conf/global_settings.py:66
#: conf/global_settings.py:68
msgid "Macedonian"
msgstr "Macedoński"
#: conf/global_settings.py:67
#: conf/global_settings.py:69
msgid "Dutch"
msgstr "Holenderski"
#: conf/global_settings.py:68
#: conf/global_settings.py:70
msgid "Norwegian"
msgstr "Norweski"
#: conf/global_settings.py:69
#: conf/global_settings.py:71
msgid "Polish"
msgstr "Polski"
#: conf/global_settings.py:70
#: conf/global_settings.py:72
msgid "Portugese"
msgstr "Portugalski"
#: conf/global_settings.py:71
#: conf/global_settings.py:73
msgid "Brazilian"
msgstr "Brazylijski"
#: conf/global_settings.py:72
#: conf/global_settings.py:74
msgid "Romanian"
msgstr "Rumuński"
#: conf/global_settings.py:73
#: conf/global_settings.py:75
msgid "Russian"
msgstr "Rosyjski"
#: conf/global_settings.py:74
#: conf/global_settings.py:76
msgid "Slovak"
msgstr "Słowacki"
#: conf/global_settings.py:75
#: conf/global_settings.py:77
msgid "Slovenian"
msgstr "Słoweński"
#: conf/global_settings.py:76
#: conf/global_settings.py:78
msgid "Serbian"
msgstr "Serbski"
#: conf/global_settings.py:77
#: conf/global_settings.py:79
msgid "Swedish"
msgstr "Szwedzki"
#: conf/global_settings.py:78
#: conf/global_settings.py:80
msgid "Tamil"
msgstr "Tamilski"
#: conf/global_settings.py:79
#: conf/global_settings.py:81
msgid "Telugu"
msgstr "Telugu"
#: conf/global_settings.py:80
#: conf/global_settings.py:82
msgid "Turkish"
msgstr "Turecki"
#: conf/global_settings.py:81
#: conf/global_settings.py:83
msgid "Ukrainian"
msgstr "Ukraiński"
#: conf/global_settings.py:82
#: conf/global_settings.py:84
msgid "Simplified Chinese"
msgstr "Uproszczony chiński"
#: conf/global_settings.py:83
#: conf/global_settings.py:85
msgid "Traditional Chinese"
msgstr "Chiński tradycyjny"
@ -472,7 +480,7 @@ msgid "Password:"
msgstr "Hasło:"
#: contrib/admin/templates/admin/login.html:25
#: contrib/admin/views/decorators.py:25
#: contrib/admin/views/decorators.py:31
msgid "Log in"
msgstr "Zaloguj się"
@ -791,7 +799,7 @@ msgstr "Hasło zostało zmienione pomyślnie."
msgid "Change password: %s"
msgstr "Zmień hasło: %s"
#: contrib/admin/views/decorators.py:11 contrib/auth/forms.py:60
#: contrib/admin/views/decorators.py:17 contrib/auth/forms.py:60
msgid ""
"Please enter a correct username and password. Note that both fields are case-"
"sensitive."
@ -799,7 +807,7 @@ msgstr ""
"Proszę wpisać poprawną nazwę użytkownika i hasło. Uwaga: wielkość liter ma "
"znaczenie."
#: contrib/admin/views/decorators.py:63
#: contrib/admin/views/decorators.py:69
msgid ""
"Please log in again, because your session has expired. Don't worry: Your "
"submission has been saved."
@ -807,7 +815,7 @@ msgstr ""
"Zaloguj się ponownie. Twoja sesja wygasła lecz twoje zgłoszenie zostało "
"zapisane."
#: contrib/admin/views/decorators.py:70
#: contrib/admin/views/decorators.py:76
msgid ""
"Looks like your browser isn't configured to accept cookies. Please enable "
"cookies, reload this page, and try again."
@ -815,11 +823,11 @@ msgstr ""
"Twoja przeglądarka nie chce akceptować ciasteczek. Zmień jej ustawienia i "
"spróbuj ponownie."
#: contrib/admin/views/decorators.py:84
#: contrib/admin/views/decorators.py:90
msgid "Usernames cannot contain the '@' character."
msgstr "Nazwy użytkowników nie mogą zawierać znaków '@'."
#: contrib/admin/views/decorators.py:86
#: contrib/admin/views/decorators.py:92
#, python-format
msgid "Your e-mail address is not your username. Try '%s' instead."
msgstr "Twój adres e-mail to nie jest twój login. Spróbuj '%s'."
@ -947,7 +955,7 @@ msgstr "Tekst"
msgid "Time"
msgstr "Czas"
#: contrib/admin/views/doc.py:318 contrib/flatpages/models.py:7
#: contrib/admin/views/doc.py:318 contrib/flatpages/models.py:8
msgid "URL"
msgstr "URL"
@ -1542,42 +1550,42 @@ msgstr "Błędny ID komentarza"
msgid "No voting for yourself"
msgstr "Nie można głosować na siebie"
#: contrib/contenttypes/models.py:37
#: contrib/contenttypes/models.py:67
msgid "python model class name"
msgstr "nazwa pythonowa modelu klasy"
#: contrib/contenttypes/models.py:40
#: contrib/contenttypes/models.py:71
msgid "content type"
msgstr "typ zawartości"
#: contrib/contenttypes/models.py:41
#: contrib/contenttypes/models.py:72
msgid "content types"
msgstr "typy zawartości"
#: contrib/flatpages/models.py:8
#: contrib/flatpages/models.py:9
msgid ""
"Example: '/about/contact/'. Make sure to have leading and trailing slashes."
msgstr ""
"Przykład: '/about/contact/'. Upewnij się że wpisałeś otwierający i "
"zamykający ukośnik."
#: contrib/flatpages/models.py:9
#: contrib/flatpages/models.py:10
msgid "title"
msgstr "tytuł"
#: contrib/flatpages/models.py:10
#: contrib/flatpages/models.py:11
msgid "content"
msgstr "zawartość"
#: contrib/flatpages/models.py:11
#: contrib/flatpages/models.py:12
msgid "enable comments"
msgstr "włącz komentarze"
#: contrib/flatpages/models.py:12
#: contrib/flatpages/models.py:13
msgid "template name"
msgstr "nazwa szablonu"
#: contrib/flatpages/models.py:13
#: contrib/flatpages/models.py:14
msgid ""
"Example: 'flatpages/contact_page.html'. If this isn't provided, the system "
"will use 'flatpages/default.html'."
@ -1585,40 +1593,44 @@ msgstr ""
"Przykład: 'flatpages/contact_page.html'. Jeżeli nie zostanie podane, system "
"użyje 'flatpages/default.html'."
#: contrib/flatpages/models.py:14
#: contrib/flatpages/models.py:15
msgid "registration required"
msgstr "wymagana rejestracja"
#: contrib/flatpages/models.py:14
#: contrib/flatpages/models.py:15
msgid "If this is checked, only logged-in users will be able to view the page."
msgstr ""
"Jeżeli zaznaczone - tylko zalogowani użytkownicy będą mogli zobaczyć stronę."
#: contrib/flatpages/models.py:18
#: contrib/flatpages/models.py:20
msgid "flat page"
msgstr "strona statyczna"
#: contrib/flatpages/models.py:19
#: contrib/flatpages/models.py:21
msgid "flat pages"
msgstr "strony statyczne"
#: contrib/humanize/templatetags/humanize.py:20
#: contrib/flatpages/models.py:27
msgid "Advanced options"
msgstr "Opcje zaawansowane"
#: contrib/humanize/templatetags/humanize.py:19
msgid "th"
msgstr "-y"
#: contrib/humanize/templatetags/humanize.py:20
#: contrib/humanize/templatetags/humanize.py:19
msgid "st"
msgstr "-szy"
#: contrib/humanize/templatetags/humanize.py:20
#: contrib/humanize/templatetags/humanize.py:19
msgid "nd"
msgstr "-gi"
#: contrib/humanize/templatetags/humanize.py:20
#: contrib/humanize/templatetags/humanize.py:19
msgid "rd"
msgstr "-ci"
#: contrib/humanize/templatetags/humanize.py:52
#: contrib/humanize/templatetags/humanize.py:51
#, python-format
msgid "%(value).1f million"
msgid_plural "%(value).1f million"
@ -1626,7 +1638,7 @@ msgstr[0] "%(value).1f milion"
msgstr[1] "%(value).1f miliony"
msgstr[2] "%(value).1f milionów"
#: contrib/humanize/templatetags/humanize.py:55
#: contrib/humanize/templatetags/humanize.py:54
#, python-format
msgid "%(value).1f billion"
msgid_plural "%(value).1f billion"
@ -1634,7 +1646,7 @@ msgstr[0] "%(value).1f miliard"
msgstr[1] "%(value).1f miliardy"
msgstr[2] "%(value).1f miliardów"
#: contrib/humanize/templatetags/humanize.py:58
#: contrib/humanize/templatetags/humanize.py:57
#, python-format
msgid "%(value).1f trillion"
msgid_plural "%(value).1f trillion"
@ -1642,73 +1654,73 @@ msgstr[0] "%(value).1f bilion"
msgstr[1] "%(value).1f biliony"
msgstr[2] "%(value).1f bilionów"
#: contrib/humanize/templatetags/humanize.py:74
#: contrib/humanize/templatetags/humanize.py:73
msgid "one"
msgstr "jeden"
#: contrib/humanize/templatetags/humanize.py:74
#: contrib/humanize/templatetags/humanize.py:73
msgid "two"
msgstr "dwa"
#: contrib/humanize/templatetags/humanize.py:74
#: contrib/humanize/templatetags/humanize.py:73
msgid "three"
msgstr "trzy"
#: contrib/humanize/templatetags/humanize.py:74
#: contrib/humanize/templatetags/humanize.py:73
msgid "four"
msgstr "cztery"
#: contrib/humanize/templatetags/humanize.py:74
#: contrib/humanize/templatetags/humanize.py:73
msgid "five"
msgstr "pięć"
#: contrib/humanize/templatetags/humanize.py:74
#: contrib/humanize/templatetags/humanize.py:73
msgid "six"
msgstr "sześć"
#: contrib/humanize/templatetags/humanize.py:74
#: contrib/humanize/templatetags/humanize.py:73
msgid "seven"
msgstr "siedem"
#: contrib/humanize/templatetags/humanize.py:74
#: contrib/humanize/templatetags/humanize.py:73
msgid "eight"
msgstr "osiem"
#: contrib/humanize/templatetags/humanize.py:74
#: contrib/humanize/templatetags/humanize.py:73
msgid "nine"
msgstr "dziewięć"
#: contrib/humanize/templatetags/humanize.py:94
#: contrib/humanize/templatetags/humanize.py:93
msgid "today"
msgstr "dzisiaj"
#: contrib/humanize/templatetags/humanize.py:96
#: contrib/humanize/templatetags/humanize.py:95
msgid "tomorrow"
msgstr "jutro"
#: contrib/humanize/templatetags/humanize.py:98
#: contrib/humanize/templatetags/humanize.py:97
msgid "yesterday"
msgstr "wczoraj"
#: contrib/localflavor/ar/forms.py:28
#: contrib/localflavor/ar/forms.py:27
msgid "Enter a postal code in the format NNNN or ANNNNAAA."
msgstr "Wpisz kod pocztowy w formacie NNNN lub ANNNNAAA."
#: contrib/localflavor/ar/forms.py:50 contrib/localflavor/br/forms.py:96
#: contrib/localflavor/ar/forms.py:49 contrib/localflavor/br/forms.py:96
#: contrib/localflavor/br/forms.py:135 contrib/localflavor/pe/forms.py:23
#: contrib/localflavor/pe/forms.py:51
msgid "This field requires only numbers."
msgstr "To pole może zawierać jedynie liczby."
#: contrib/localflavor/ar/forms.py:51
#: contrib/localflavor/ar/forms.py:50
msgid "This field requires 7 or 8 digits."
msgstr "To pole musi zawierać 7 lub 8 cyfr."
#: contrib/localflavor/ar/forms.py:80
#: contrib/localflavor/ar/forms.py:79
msgid "Enter a valid CUIT in XX-XXXXXXXX-X or XXXXXXXXXXXX format."
msgstr "Podaj poprawny numer CUIT w formacie XX-XXXXXXXX-X lub XXXXXXXXXXXX."
#: contrib/localflavor/ar/forms.py:81
#: contrib/localflavor/ar/forms.py:80
msgid "Invalid CUIT."
msgstr "Niepoprawny CUIT"
@ -2300,7 +2312,7 @@ msgstr "Wpisz poprawny numer ubezpieczenia socjalnego."
msgid "Enter a valid VAT number."
msgstr "Wpisz poprawny numer VAT."
#: contrib/localflavor/jp/forms.py:19
#: contrib/localflavor/jp/forms.py:17
msgid "Enter a postal code in the format XXXXXXX or XXX-XXXX."
msgstr "Wpisz kod pocztowy w formacie XXXXXXX lub XXX-XXXX."
@ -2549,11 +2561,13 @@ msgid "Jalisco"
msgstr "Jalisco"
#: contrib/localflavor/mx/mx_states.py:26
msgid "Estado de México"
#, fuzzy
msgid "Estado de México"
msgstr "Meksyk (stan)"
#: contrib/localflavor/mx/mx_states.py:27
msgid "Michoacán"
#, fuzzy
msgid "Michoacán"
msgstr "Michocan"
#: contrib/localflavor/mx/mx_states.py:28
@ -2565,7 +2579,8 @@ msgid "Nayarit"
msgstr "Nayarit"
#: contrib/localflavor/mx/mx_states.py:30
msgid "Nuevo León"
#, fuzzy
msgid "Nuevo León"
msgstr "Nuevo Leon"
#: contrib/localflavor/mx/mx_states.py:31
@ -2577,7 +2592,8 @@ msgid "Puebla"
msgstr "Puebla"
#: contrib/localflavor/mx/mx_states.py:33
msgid "Querétaro"
#, fuzzy
msgid "Querétaro"
msgstr "Queretaro"
#: contrib/localflavor/mx/mx_states.py:34
@ -2589,7 +2605,8 @@ msgid "Sinaloa"
msgstr "Sinaloa"
#: contrib/localflavor/mx/mx_states.py:36
msgid "San Luis Potosí"
#, fuzzy
msgid "San Luis Potosí"
msgstr "San Luis Potasi"
#: contrib/localflavor/mx/mx_states.py:37
@ -2613,7 +2630,8 @@ msgid "Veracruz"
msgstr "Veracruz"
#: contrib/localflavor/mx/mx_states.py:42
msgid "Yucatán"
#, fuzzy
msgid "Yucatán"
msgstr "Jukatan"
#: contrib/localflavor/mx/mx_states.py:43
@ -3501,23 +3519,23 @@ msgstr "przekieruj"
msgid "redirects"
msgstr "przekierowania"
#: contrib/sessions/models.py:46
#: contrib/sessions/models.py:41
msgid "session key"
msgstr "klucz sesji"
#: contrib/sessions/models.py:47
#: contrib/sessions/models.py:42
msgid "session data"
msgstr "data sesji"
#: contrib/sessions/models.py:48
#: contrib/sessions/models.py:43
msgid "expire date"
msgstr "data wygaśnięcia sesji"
#: contrib/sessions/models.py:53
#: contrib/sessions/models.py:48
msgid "session"
msgstr "sesja"
#: contrib/sessions/models.py:54
#: contrib/sessions/models.py:49
msgid "sessions"
msgstr "sesje"
@ -3585,7 +3603,7 @@ msgstr "Tu mogą być tylko cyfry."
msgid "This value can't be comprised solely of digits."
msgstr "To pole nie może zawierać jedynie cyfr."
#: core/validators.py:128 newforms/fields.py:151
#: core/validators.py:128 newforms/fields.py:152
msgid "Enter a whole number."
msgstr "Wpisz liczbę całkowitą."
@ -3602,7 +3620,7 @@ msgstr "Rok nie może być wcześniejszy niż 1900."
msgid "Invalid date: %s"
msgstr "Niepoprawna data: %s"
#: core/validators.py:156 db/models/fields/__init__.py:509
#: core/validators.py:156 db/models/fields/__init__.py:527
msgid "Enter a valid date in YYYY-MM-DD format."
msgstr "Proszę wpisać poprawną datę w formacie RRRR-MM-DD."
@ -3610,20 +3628,20 @@ msgstr "Proszę wpisać poprawną datę w formacie RRRR-MM-DD."
msgid "Enter a valid time in HH:MM format."
msgstr "Proszę wpisać poprawną godzinę w formacie HH:MM."
#: core/validators.py:165 db/models/fields/__init__.py:583
#: core/validators.py:165 db/models/fields/__init__.py:604
msgid "Enter a valid date/time in YYYY-MM-DD HH:MM format."
msgstr "Wprowadź poprawną datę i godzinę w formacie RRRR-MM-DD GG:MM."
#: core/validators.py:170 newforms/fields.py:402
#: core/validators.py:170 newforms/fields.py:403
msgid "Enter a valid e-mail address."
msgstr "Wprowadź poprawny adres e-mail."
#: core/validators.py:182 core/validators.py:474 newforms/fields.py:432
#: core/validators.py:182 core/validators.py:474 newforms/fields.py:433
#: oldforms/__init__.py:687
msgid "No file was submitted. Check the encoding type on the form."
msgstr "Nie wysłano żadnego pliku. Sprawdź typ kodowania formularza."
#: core/validators.py:193 newforms/fields.py:458
#: core/validators.py:193 newforms/fields.py:459
msgid ""
"Upload a valid image. The file you uploaded was either not an image or a "
"corrupted image."
@ -3879,54 +3897,54 @@ msgstr "%(object)s z %(type)s już istnieje dla %(field)s."
msgid "%(optname)s with this %(fieldname)s already exists."
msgstr "Już istnieje %(optname)s z %(fieldname)s."
#: db/models/fields/__init__.py:161 db/models/fields/__init__.py:318
#: db/models/fields/__init__.py:735 db/models/fields/__init__.py:746
#: newforms/fields.py:45 oldforms/__init__.py:374
#: db/models/fields/__init__.py:161 db/models/fields/__init__.py:327
#: db/models/fields/__init__.py:759 db/models/fields/__init__.py:770
#: newforms/fields.py:46 oldforms/__init__.py:374
msgid "This field is required."
msgstr "To pole jest wymagane."
#: db/models/fields/__init__.py:418
#: db/models/fields/__init__.py:427
msgid "This value must be an integer."
msgstr "Ta wartość musi być liczbą całkowitą."
#: db/models/fields/__init__.py:454
#: db/models/fields/__init__.py:466
msgid "This value must be either True or False."
msgstr "Ta wartość musi być logiczna (True, False - prawda lub fałsz)."
#: db/models/fields/__init__.py:475
#: db/models/fields/__init__.py:490
msgid "This field cannot be null."
msgstr "To pole nie może być puste."
#: db/models/fields/__init__.py:644
#: db/models/fields/__init__.py:668
msgid "This value must be a decimal number."
msgstr "Ta wartość musi być liczbą dziesiętną."
#: db/models/fields/__init__.py:755
#: db/models/fields/__init__.py:779
msgid "Enter a valid filename."
msgstr "Wpisz poprawną nazwę pliku."
#: db/models/fields/__init__.py:908
#: db/models/fields/__init__.py:960
msgid "This value must be either None, True or False."
msgstr ""
"Ta wartość musi być jedną z None (żadne), True (prawda) lub False (fałsz)."
#: db/models/fields/related.py:55
#: db/models/fields/related.py:93
#, python-format
msgid "Please enter a valid %s."
msgstr "Proszę wpisać poprawne %s."
#: db/models/fields/related.py:658
#: db/models/fields/related.py:701
msgid "Separate multiple IDs with commas."
msgstr "Oddziel identyfikatory przecinkami."
#: db/models/fields/related.py:660
#: db/models/fields/related.py:703
msgid ""
"Hold down \"Control\", or \"Command\" on a Mac, to select more than one."
msgstr ""
"Przytrzymaj wciśnięty klawisz \"Ctrl\" lub \"Command\" na Mac'u aby "
"zaznaczyć więcej niż jeden wybór."
#: db/models/fields/related.py:707
#: db/models/fields/related.py:750
#, python-format
msgid "Please enter valid %(self)s IDs. The value %(value)r is invalid."
msgid_plural ""
@ -3941,100 +3959,100 @@ msgstr[2] ""
"Proszę podać poprawne identyfikatory %(self)s. Wartości %(value)r są "
"niepoprawne."
#: newforms/fields.py:46
#: newforms/fields.py:47
msgid "Enter a valid value."
msgstr "Wpisz poprawną wartość."
#: newforms/fields.py:123
#: newforms/fields.py:124
#, python-format
msgid "Ensure this value has at most %(max)d characters (it has %(length)d)."
msgstr ""
"Upewnij się, że ta wartość ma co najwyżej %(max)d znaków (ma długość %"
"(length)d)."
#: newforms/fields.py:124
#: newforms/fields.py:125
#, python-format
msgid "Ensure this value has at least %(min)d characters (it has %(length)d)."
msgstr ""
"Upewnij się, że ta wartość ma co najmniej %(min)d znaków (ma długość %"
"(length)d)."
#: newforms/fields.py:152 newforms/fields.py:181 newforms/fields.py:210
#: newforms/fields.py:153 newforms/fields.py:182 newforms/fields.py:211
#, python-format
msgid "Ensure this value is less than or equal to %s."
msgstr "Upewnij się, że ta wartość jest mniejsza lub równa %s."
#: newforms/fields.py:153 newforms/fields.py:182 newforms/fields.py:211
#: newforms/fields.py:154 newforms/fields.py:183 newforms/fields.py:212
#, python-format
msgid "Ensure this value is greater than or equal to %s."
msgstr "Upewnij się, że ta wartość jest większa lub równa %s."
#: newforms/fields.py:180 newforms/fields.py:209
#: newforms/fields.py:181 newforms/fields.py:210
msgid "Enter a number."
msgstr "Wpisz liczbę."
#: newforms/fields.py:212
#: newforms/fields.py:213
#, python-format
msgid "Ensure that there are no more than %s digits in total."
msgstr "Upewnij się, że jest nie więcej niż %s cyfr."
#: newforms/fields.py:213
#: newforms/fields.py:214
#, python-format
msgid "Ensure that there are no more than %s decimal places."
msgstr "Upewnij się, że jest nie więcej niż %s miejsc po przecinku."
#: newforms/fields.py:214
#: newforms/fields.py:215
#, python-format
msgid "Ensure that there are no more than %s digits before the decimal point."
msgstr "Upewnij się, że jest nie więcej niż %s miejsc przed przecinkiem."
#: newforms/fields.py:262 newforms/fields.py:723
#: newforms/fields.py:263 newforms/fields.py:751
msgid "Enter a valid date."
msgstr "Wpisz poprawną datę."
#: newforms/fields.py:295 newforms/fields.py:724
#: newforms/fields.py:296 newforms/fields.py:752
msgid "Enter a valid time."
msgstr "Wpisz poprawną godzinę."
#: newforms/fields.py:334
#: newforms/fields.py:335
msgid "Enter a valid date/time."
msgstr "Wpisz poprawną datę/godzinę."
#: newforms/fields.py:433
#: newforms/fields.py:434
msgid "No file was submitted."
msgstr "Żaden plik nie został przesłany."
#: newforms/fields.py:434 oldforms/__init__.py:689
#: newforms/fields.py:435 oldforms/__init__.py:689
msgid "The submitted file is empty."
msgstr "Wysłany plik jest pusty."
#: newforms/fields.py:496
#: newforms/fields.py:497
msgid "Enter a valid URL."
msgstr "Wpisz poprawny URL."
#: newforms/fields.py:497
#: newforms/fields.py:498
msgid "This URL appears to be a broken link."
msgstr "Ten odnośnik jest nieprawidłowy."
#: newforms/fields.py:559 newforms/models.py:317
#: newforms/fields.py:560 newforms/models.py:299
msgid "Select a valid choice. That choice is not one of the available choices."
msgstr "Wybierz poprawną wartość. Podana nie jest jednym z dostępnych wyborów."
#: newforms/fields.py:598
#: newforms/fields.py:599
#, python-format
msgid "Select a valid choice. %(value)s is not one of the available choices."
msgstr ""
"Wybierz poprawną wartość. %(value)s nie jest jednym z dostępnych wyborów."
#: newforms/fields.py:599 newforms/fields.py:661 newforms/models.py:377
#: newforms/fields.py:600 newforms/fields.py:662 newforms/models.py:371
msgid "Enter a list of values."
msgstr "Podaj listę wartości."
#: newforms/fields.py:752
#: newforms/fields.py:780
msgid "Enter a valid IPv4 address."
msgstr "Wprowadź poprawny adres IPv4."
#: newforms/models.py:378
#: newforms/models.py:372
#, python-format
msgid "Select a valid choice. %s is not one of the available choices."
msgstr "Wybierz poprawną wartość. %s nie jest jednym z dostępnych wyborów."
@ -4068,11 +4086,11 @@ msgstr "Proszę wpisać liczbę dodatnią."
msgid "Enter a whole number between 0 and 32,767."
msgstr "Proszę wpisać liczbę całkowitą z zakresu od 0 do 32 767"
#: template/defaultfilters.py:691
#: template/defaultfilters.py:698
msgid "yes,no,maybe"
msgstr "tak,nie,może"
#: template/defaultfilters.py:722
#: template/defaultfilters.py:729
#, python-format
msgid "%(size)d byte"
msgid_plural "%(size)d bytes"
@ -4080,17 +4098,17 @@ msgstr[0] "%(size)d bajt"
msgstr[1] "%(size)d bajty"
msgstr[2] "%(size)d bajtów"
#: template/defaultfilters.py:724
#: template/defaultfilters.py:731
#, python-format
msgid "%.1f KB"
msgstr "%.1f KB"
#: template/defaultfilters.py:726
#: template/defaultfilters.py:733
#, python-format
msgid "%.1f MB"
msgstr "%.1f MB"
#: template/defaultfilters.py:727
#: template/defaultfilters.py:734
#, python-format
msgid "%.1f GB"
msgstr "%.1f GB"
@ -4359,23 +4377,23 @@ msgstr "%(number)d %(type)s"
msgid ", %(number)d %(type)s"
msgstr ", %(number)d %(type)s"
#: utils/translation/trans_real.py:404
#: utils/translation/trans_real.py:403
msgid "DATE_FORMAT"
msgstr "Y-m-d"
#: utils/translation/trans_real.py:405
#: utils/translation/trans_real.py:404
msgid "DATETIME_FORMAT"
msgstr "Y-m-d H:i:s"
#: utils/translation/trans_real.py:406
#: utils/translation/trans_real.py:405
msgid "TIME_FORMAT"
msgstr "H:i:s"
#: utils/translation/trans_real.py:422
#: utils/translation/trans_real.py:421
msgid "YEAR_MONTH_FORMAT"
msgstr "Y-m"
#: utils/translation/trans_real.py:423
#: utils/translation/trans_real.py:422
msgid "MONTH_DAY_FORMAT"
msgstr "m-d"
@ -4394,6 +4412,9 @@ msgstr "%(verbose_name)s zostało pomyślnie zmienione."
msgid "The %(verbose_name)s was deleted."
msgstr "%(verbose_name)s zostało usunięte."
#~ msgid "Gaeilge"
#~ msgstr "Gaelicki"
#~ msgid ""
#~ "Enter a postcode. A space is required between the two postcode parts."
#~ msgstr ""

File diff suppressed because it is too large Load Diff

View File

@ -8,8 +8,8 @@ msgstr ""
"Project-Id-Version: Django\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2006-05-16 10:10+0200\n"
"PO-Revision-Date: 2007-07-05 12:44+0800\n"
"Last-Translator: limodou <limodou@gmail.com>\n"
"PO-Revision-Date: 2008-04-02 11:43+0800\n"
"Last-Translator: hutuworm <hutuworm@gmail.com>\n"
"Language-Team: Simplified Chinese <limodou@gmail.com>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
@ -66,7 +66,7 @@ msgstr "%(optname)s 带有 %(fieldname)s 已经存在。"
#: newforms/fields.py:463
#: newforms/models.py:178
msgid "This field is required."
msgstr "这个字段是必项。"
msgstr "这个字段是必项。"
#: db/models/fields/__init__.py:367
msgid "This value must be an integer."
@ -443,19 +443,19 @@ msgstr "十二月"
#: utils/dateformat.py:40
msgid "p.m."
msgstr ""
msgstr "p.m."
#: utils/dateformat.py:41
msgid "a.m."
msgstr ""
msgstr "a.m."
#: utils/dateformat.py:46
msgid "PM"
msgstr ""
msgstr "PM"
#: utils/dateformat.py:47
msgid "AM"
msgstr ""
msgstr "AM"
#: utils/dateformat.py:95
msgid "midnight"
@ -667,7 +667,7 @@ msgstr "京都"
#: contrib/localflavor/jp/jp_prefectures.py:30
msgid "Osaka"
msgstr " 大坂"
msgstr "大坂"
#: contrib/localflavor/jp/jp_prefectures.py:31
msgid "Hyogo"
@ -800,7 +800,7 @@ msgstr "黑森州"
#: contrib/localflavor/de/de_states.py:12
msgid "Mecklenburg-Western Pomerania"
msgstr ""
msgstr "梅克伦堡-西部米拉尼亚"
#: contrib/localflavor/de/de_states.py:13
msgid "Lower Saxony"
@ -812,7 +812,7 @@ msgstr "北莱茵-威斯特法伦州"
#: contrib/localflavor/de/de_states.py:15
msgid "Rhineland-Palatinate"
msgstr ""
msgstr "莱茵河法耳茨地区"
#: contrib/localflavor/de/de_states.py:16
msgid "Saarland"
@ -824,7 +824,7 @@ msgstr "萨克森"
#: contrib/localflavor/de/de_states.py:18
msgid "Saxony-Anhalt"
msgstr ""
msgstr "萨克森-安哈尔特"
#: contrib/localflavor/de/de_states.py:19
msgid "Schleswig-Holstein"
@ -1025,19 +1025,19 @@ msgstr "消息"
#: contrib/humanize/templatetags/humanize.py:17
msgid "th"
msgstr ""
msgstr "th"
#: contrib/humanize/templatetags/humanize.py:17
msgid "st"
msgstr ""
msgstr "st"
#: contrib/humanize/templatetags/humanize.py:17
msgid "nd"
msgstr ""
msgstr "nd"
#: contrib/humanize/templatetags/humanize.py:17
msgid "rd"
msgstr ""
msgstr "rd"
#: contrib/humanize/templatetags/humanize.py:47
#, python-format
@ -1465,7 +1465,7 @@ msgid ""
"\n"
"%(text)s"
msgstr ""
"此评论由一个肤浅的用户张贴:\n"
"此评论由一个粗率的用户张贴:\n"
"\n"
"%(text)s"
@ -1477,7 +1477,7 @@ msgstr "只允许张贴"
#: contrib/comments/views/comments.py:192
#: contrib/comments/views/comments.py:284
msgid "One or more of the required fields wasn't submitted"
msgstr "一个或多个必字段没有被提交"
msgstr "一个或多个必字段没有被提交"
#: contrib/comments/views/comments.py:196
#: contrib/comments/views/comments.py:286

View File

@ -22,7 +22,7 @@ def paginator_number(cl,i):
elif i == cl.page_num:
return mark_safe(u'<span class="this-page">%d</span> ' % (i+1))
else:
return mark_safe(u'<a href="%s"%s>%d</a> ' % (cl.get_query_string({PAGE_VAR: i}), (i == cl.paginator.pages-1 and ' class="end"' or ''), i+1))
return mark_safe(u'<a href="%s"%s>%d</a> ' % (cl.get_query_string({PAGE_VAR: i}), (i == cl.paginator.num_pages-1 and ' class="end"' or ''), i+1))
paginator_number = register.simple_tag(paginator_number)
def pagination(cl):
@ -37,8 +37,8 @@ def pagination(cl):
# If there are 10 or fewer pages, display links to every page.
# Otherwise, do some fancy
if paginator.pages <= 10:
page_range = range(paginator.pages)
if paginator.num_pages <= 10:
page_range = range(paginator.num_pages)
else:
# Insert "smart" pagination links, so that there are always ON_ENDS
# links at either end of the list of pages, and there are always
@ -50,12 +50,12 @@ def pagination(cl):
page_range.extend(range(page_num - ON_EACH_SIDE, page_num + 1))
else:
page_range.extend(range(0, page_num + 1))
if page_num < (paginator.pages - ON_EACH_SIDE - ON_ENDS - 1):
if page_num < (paginator.num_pages - ON_EACH_SIDE - ON_ENDS - 1):
page_range.extend(range(page_num + 1, page_num + ON_EACH_SIDE + 1))
page_range.append(DOT)
page_range.extend(range(paginator.pages - ON_ENDS, paginator.pages))
page_range.extend(range(paginator.num_pages - ON_ENDS, paginator.num_pages))
else:
page_range.extend(range(page_num + 1, paginator.pages))
page_range.extend(range(page_num + 1, paginator.num_pages))
need_show_all_link = cl.can_show_all and not cl.show_all and cl.multi_page
return {

View File

@ -5,7 +5,7 @@ from django.contrib.admin.views.decorators import staff_member_required
from django.views.decorators.cache import never_cache
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import ImproperlyConfigured, ObjectDoesNotExist, PermissionDenied
from django.core.paginator import ObjectPaginator, InvalidPage
from django.core.paginator import QuerySetPaginator, InvalidPage
from django.shortcuts import get_object_or_404, render_to_response
from django.db import models
from django.db.models.query import handle_legacy_orderlist, QuerySet
@ -611,11 +611,11 @@ class ChangeList(object):
return mark_safe('?' + '&amp;'.join([u'%s=%s' % (k, v) for k, v in p.items()]).replace(' ', '%20'))
def get_results(self, request):
paginator = ObjectPaginator(self.query_set, self.lookup_opts.admin.list_per_page)
paginator = QuerySetPaginator(self.query_set, self.lookup_opts.admin.list_per_page)
# Get the number of objects, with admin filters applied.
try:
result_count = paginator.hits
result_count = paginator.count
# Naked except! Because we don't have any other way of validating
# "params". They might be invalid if the keyword arguments are
# incorrect, or if the values are not in the correct type (which would
@ -640,7 +640,7 @@ class ChangeList(object):
result_list = list(self.query_set)
else:
try:
result_list = paginator.get_page(self.page_num)
result_list = paginator.page(self.page_num+1).object_list
except InvalidPage:
result_list = ()

View File

@ -3,6 +3,7 @@ from django.db import models
from django.contrib.sites.models import Site
from django.utils.translation import ugettext_lazy as _
class FlatPage(models.Model):
url = models.CharField(_('URL'), max_length=100, validator_list=[validators.isAlphaNumericURL], db_index=True,
help_text=_("Example: '/about/contact/'. Make sure to have leading and trailing slashes."))
@ -13,15 +14,17 @@ class FlatPage(models.Model):
help_text=_("Example: 'flatpages/contact_page.html'. If this isn't provided, the system will use 'flatpages/default.html'."))
registration_required = models.BooleanField(_('registration required'), help_text=_("If this is checked, only logged-in users will be able to view the page."))
sites = models.ManyToManyField(Site)
class Meta:
db_table = 'django_flatpage'
verbose_name = _('flat page')
verbose_name_plural = _('flat pages')
ordering = ('url',)
class Admin:
fields = (
(None, {'fields': ('url', 'title', 'content', 'sites')}),
('Advanced options', {'classes': 'collapse', 'fields': ('enable_comments', 'registration_required', 'template_name')}),
(_('Advanced options'), {'classes': 'collapse', 'fields': ('enable_comments', 'registration_required', 'template_name')}),
)
list_filter = ('sites',)
search_fields = ('url', 'title')

View File

@ -294,8 +294,14 @@ def sql_model_create(model, style, known_models=set()):
style.SQL_COLTYPE(models.IntegerField().db_type()) + ' ' + \
style.SQL_KEYWORD('NULL'))
for field_constraints in opts.unique_together:
table_output.append(style.SQL_KEYWORD('UNIQUE') + ' (%s)' % \
constraint_output = [style.SQL_KEYWORD('UNIQUE')]
constraint_output.append('(%s)' % \
", ".join([style.SQL_FIELD(qn(opts.get_field(f).column)) for f in field_constraints]))
if opts.db_tablespace and connection.features.supports_tablespaces \
and connection.features.autoindexes_primary_keys:
constraint_output.append(connection.ops.tablespace_sql(
opts.db_tablespace, inline=True))
table_output.append(' '.join(constraint_output))
full_statement = [style.SQL_KEYWORD('CREATE TABLE') + ' ' + style.SQL_TABLE(qn(opts.db_table)) + ' (']
for i, line in enumerate(table_output): # Combine and add commas.

View File

@ -1,112 +0,0 @@
"""
ADO MSSQL database backend for Django.
Requires adodbapi 2.0.1: http://adodbapi.sourceforge.net/
"""
from django.db.backends import BaseDatabaseWrapper, BaseDatabaseFeatures, BaseDatabaseOperations, util
try:
import adodbapi as Database
except ImportError, e:
from django.core.exceptions import ImproperlyConfigured
raise ImproperlyConfigured("Error loading adodbapi module: %s" % e)
import datetime
try:
import mx
except ImportError:
mx = None
DatabaseError = Database.DatabaseError
IntegrityError = Database.IntegrityError
# We need to use a special Cursor class because adodbapi expects question-mark
# param style, but Django expects "%s". This cursor converts question marks to
# format-string style.
class Cursor(Database.Cursor):
def executeHelper(self, operation, isStoredProcedureCall, parameters=None):
if parameters is not None and "%s" in operation:
operation = operation.replace("%s", "?")
Database.Cursor.executeHelper(self, operation, isStoredProcedureCall, parameters)
class Connection(Database.Connection):
def cursor(self):
return Cursor(self)
Database.Connection = Connection
origCVtoP = Database.convertVariantToPython
def variantToPython(variant, adType):
if type(variant) == bool and adType == 11:
return variant # bool not 1/0
res = origCVtoP(variant, adType)
if mx is not None and type(res) == mx.DateTime.mxDateTime.DateTimeType:
# Convert ms.DateTime objects to Python datetime.datetime objects.
tv = list(res.tuple()[:7])
tv[-2] = int(tv[-2])
return datetime.datetime(*tuple(tv))
if type(res) == float and str(res)[-2:] == ".0":
return int(res) # If float but int, then int.
return res
Database.convertVariantToPython = variantToPython
class DatabaseFeatures(BaseDatabaseFeatures):
supports_tablespaces = True
class DatabaseOperations(BaseDatabaseOperations):
def date_extract_sql(self, lookup_type, field_name):
return "DATEPART(%s, %s)" % (lookup_type, field_name)
def date_trunc_sql(self, lookup_type, field_name):
if lookup_type == 'year':
return "Convert(datetime, Convert(varchar, DATEPART(year, %s)) + '/01/01')" % field_name
if lookup_type == 'month':
return "Convert(datetime, Convert(varchar, DATEPART(year, %s)) + '/' + Convert(varchar, DATEPART(month, %s)) + '/01')" % (field_name, field_name)
if lookup_type == 'day':
return "Convert(datetime, Convert(varchar(12), %s))" % field_name
def deferrable_sql(self):
return " DEFERRABLE INITIALLY DEFERRED"
def last_insert_id(self, cursor, table_name, pk_name):
cursor.execute("SELECT %s FROM %s WHERE %s = @@IDENTITY" % (pk_name, table_name, pk_name))
return cursor.fetchone()[0]
def quote_name(self, name):
if name.startswith('[') and name.endswith(']'):
return name # Quoting once is enough.
return '[%s]' % name
def random_function_sql(self):
return 'RAND()'
def tablespace_sql(self, tablespace, inline=False):
return "ON %s" % self.quote_name(tablespace)
class DatabaseWrapper(BaseDatabaseWrapper):
features = DatabaseFeatures()
ops = DatabaseOperations()
operators = {
'exact': '= %s',
'iexact': 'LIKE %s',
'contains': 'LIKE %s',
'icontains': 'LIKE %s',
'gt': '> %s',
'gte': '>= %s',
'lt': '< %s',
'lte': '<= %s',
'startswith': 'LIKE %s',
'endswith': 'LIKE %s',
'istartswith': 'LIKE %s',
'iendswith': 'LIKE %s',
}
def _cursor(self, settings):
if self.connection is None:
if settings.DATABASE_NAME == '' or settings.DATABASE_USER == '':
from django.core.exceptions import ImproperlyConfigured
raise ImproperlyConfigured("You need to specify both DATABASE_NAME and DATABASE_USER in your Django settings file.")
if not settings.DATABASE_HOST:
settings.DATABASE_HOST = "127.0.0.1"
# TODO: Handle DATABASE_PORT.
conn_string = "PROVIDER=SQLOLEDB;DATA SOURCE=%s;UID=%s;PWD=%s;DATABASE=%s" % (settings.DATABASE_HOST, settings.DATABASE_USER, settings.DATABASE_PASSWORD, settings.DATABASE_NAME)
self.connection = Database.connect(conn_string)
return self.connection.cursor()

View File

@ -1,2 +0,0 @@
def runshell():
raise NotImplementedError

View File

@ -1,26 +0,0 @@
DATA_TYPES = {
'AutoField': 'int IDENTITY (1, 1)',
'BooleanField': 'bit',
'CharField': 'varchar(%(max_length)s)',
'CommaSeparatedIntegerField': 'varchar(%(max_length)s)',
'DateField': 'smalldatetime',
'DateTimeField': 'smalldatetime',
'DecimalField': 'numeric(%(max_digits)s, %(decimal_places)s)',
'FileField': 'varchar(%(max_length)s)',
'FilePathField': 'varchar(%(max_length)s)',
'FloatField': 'double precision',
'ImageField': 'varchar(%(max_length)s)',
'IntegerField': 'int',
'IPAddressField': 'char(15)',
'NullBooleanField': 'bit',
'OneToOneField': 'int',
'PhoneNumberField': 'varchar(20)',
'PositiveIntegerField': 'int CONSTRAINT [CK_int_pos_%(column)s] CHECK ([%(column)s] > 0)',
'PositiveSmallIntegerField': 'smallint CONSTRAINT [CK_smallint_pos_%(column)s] CHECK ([%(column)s] > 0)',
'SlugField': 'varchar(%(max_length)s)',
'SmallIntegerField': 'smallint',
'TextField': 'text',
'TimeField': 'time',
'USStateField': 'varchar(2)',
'NoField': None,
}

View File

@ -1,13 +0,0 @@
def get_table_list(cursor):
raise NotImplementedError
def get_table_description(cursor, table_name):
raise NotImplementedError
def get_relations(cursor, table_name):
raise NotImplementedError
def get_indexes(cursor, table_name):
raise NotImplementedError
DATA_TYPES_REVERSE = {}

View File

@ -17,7 +17,8 @@ except ImportError, e:
version = Database.version_info
if (version < (1,2,1) or (version[:3] == (1, 2, 1) and
(len(version) < 5 or version[3] != 'final' or version[4] < 2))):
raise ImportError("MySQLdb-1.2.1p2 or newer is required; you have %s" % Database.__version__)
from django.core.exceptions import ImproperlyConfigured
raise ImproperlyConfigured("MySQLdb-1.2.1p2 or newer is required; you have %s" % Database.__version__)
from MySQLdb.converters import conversions
from MySQLdb.constants import FIELD_TYPE

View File

@ -508,7 +508,7 @@ class ForeignKey(RelatedField, Field):
if 'edit_inline_type' in kwargs:
import warnings
warnings.warn("edit_inline_type is deprecated. Use edit_inline instead.")
warnings.warn("edit_inline_type is deprecated. Use edit_inline instead.", DeprecationWarning)
kwargs['edit_inline'] = kwargs.pop('edit_inline_type')
kwargs['rel'] = ManyToOneRel(to, to_field,
@ -618,7 +618,7 @@ class OneToOneField(RelatedField, IntegerField):
if 'edit_inline_type' in kwargs:
import warnings
warnings.warn("edit_inline_type is deprecated. Use edit_inline instead.")
warnings.warn("edit_inline_type is deprecated. Use edit_inline instead.", DeprecationWarning)
kwargs['edit_inline'] = kwargs.pop('edit_inline_type')
kwargs['rel'] = OneToOneRel(to, to_field,

View File

@ -82,6 +82,17 @@ function interpolate(fmt, obj, named) {
}
"""
PluralIdx = r"""
function pluralidx(n) {
var v=%s;
if (typeof(v) == 'boolean') {
return v ? 1 : 0;
} else {
return v;
}
}
"""
def null_javascript_catalog(request, domain=None, packages=None):
"""
Returns "identity" versions of the JavaScript i18n functions -- i.e.,
@ -154,7 +165,7 @@ def javascript_catalog(request, domain='djangojs', packages=None):
# this should actually be a compiled function of a typical plural-form:
# Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;
plural = [el.strip() for el in plural.split(';') if el.strip().startswith('plural=')][0].split('=',1)[1]
src.append('function pluralidx(n) {\n return %s;\n}\n' % plural)
src.append(PluralIdx % plural)
else:
src.append(SimplePlural)
csrc = []

68
docs/Makefile Normal file
View File

@ -0,0 +1,68 @@
# Makefile for Sphinx documentation
#
# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
PAPER =
# Internal variables.
PAPEROPT_a4 = -D latex_paper_size=a4
PAPEROPT_letter = -D latex_paper_size=letter
ALLSPHINXOPTS = -d _build/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
.PHONY: help clean html web htmlhelp latex changes linkcheck
help:
@echo "Please use \`make <target>' where <target> is one of"
@echo " html to make standalone HTML files"
@echo " web to make files usable by Sphinx.web"
@echo " htmlhelp to make HTML files and a HTML help project"
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
@echo " changes to make an overview over all changed/added/deprecated items"
@echo " linkcheck to check all external links for integrity"
clean:
-rm -rf _build/*
html:
mkdir -p _build/html _build/doctrees
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) _build/html
@echo
@echo "Build finished. The HTML pages are in _build/html."
web:
mkdir -p _build/web _build/doctrees
$(SPHINXBUILD) -b web $(ALLSPHINXOPTS) _build/web
@echo
@echo "Build finished; now you can run"
@echo " python -m sphinx.web _build/web"
@echo "to start the server."
htmlhelp:
mkdir -p _build/htmlhelp _build/doctrees
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) _build/htmlhelp
@echo
@echo "Build finished; now you can run HTML Help Workshop with the" \
".hhp project file in _build/htmlhelp."
latex:
mkdir -p _build/latex _build/doctrees
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) _build/latex
@echo
@echo "Build finished; the LaTeX files are in _build/latex."
@echo "Run \`make all-pdf' or \`make all-ps' in that directory to" \
"run these through (pdf)latex."
changes:
mkdir -p _build/changes _build/doctrees
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) _build/changes
@echo
@echo "The overview file is in _build/changes."
linkcheck:
mkdir -p _build/linkcheck _build/doctrees
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) _build/linkcheck
@echo
@echo "Link check complete; look for any errors in the above output " \
"or in _build/linkcheck/output.txt."

View File

@ -819,16 +819,17 @@ Django developers are currently discussing.
Default permissions
-------------------
Three basic permissions -- add, change and delete -- are automatically created
for each Django model that has a ``class Admin`` set. Behind the scenes, these
permissions are added to the ``auth_permission`` database table when you run
``manage.py syncdb``.
When ``django.contrib.auth`` is listed in your ``INSTALLED_APPS``
setting, it will ensure that three default permissions -- add, change
and delete -- are created for each Django model defined in one of your
installed applications.
Note that if your model doesn't have ``class Admin`` set when you run
``syncdb``, the permissions won't be created. If you initialize your database
and add ``class Admin`` to models after the fact, you'll need to run
``manage.py syncdb`` again. It will create any missing permissions for
all of your installed apps.
These permissions will be created when you run ``manage.py syncdb``;
the first time you run ``syncdb`` after adding ``django.contrib.auth``
to ``INSTALLED_APPS``, the default permissions will be created for all
previously-installed models, as well as for any new models being
installed at that time. Afterward, it will create default permissions
for new models each time you run ``manage.py syncdb``.
Custom permissions
------------------

132
docs/conf.py Normal file
View File

@ -0,0 +1,132 @@
# -*- coding: utf-8 -*-
#
# Django documentation build configuration file, created by
# sphinx-quickstart on Thu Mar 27 09:06:53 2008.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# The contents of this file are pickled, so don't put values in the namespace
# that aren't pickleable (module imports are okay, they're removed automatically).
#
# All configuration values have a default value; values that are commented out
# serve to show the default value.
import sys
# If your extensions are in another directory, add it here.
#sys.path.append('some/directory')
# General configuration
# ---------------------
# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
#extensions = []
# Add any paths that contain templates here, relative to this directory.
templates_path = []
# The suffix of source filenames.
source_suffix = '.txt'
# The master toctree document.
master_doc = 'index'
# General substitutions.
project = 'Django'
copyright = '2008, Django Software Foundation'
# The default replacements for |version| and |release|, also used in various
# other places throughout the built documents.
#
# The short X.Y version.
version = 'SVN'
# The full version, including alpha/beta/rc tags.
release = version
# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
#today = ''
# Else, today_fmt is used as the format for a strftime call.
today_fmt = '%B %d, %Y'
# List of documents that shouldn't be included in the build.
#unused_docs = []
# If true, '()' will be appended to :func: etc. cross-reference text.
add_function_parentheses = True
# If true, the current module name will be prepended to all description
# unit titles (such as .. function::).
add_module_names = False
# If true, sectionauthor and moduleauthor directives will be shown in the
# output. They are ignored by default.
show_authors = False
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
# Options for HTML output
# -----------------------
# The style sheet to use for HTML and HTML Help pages. A file of that name
# must exist either in Sphinx' static/ path, or in one of the custom paths
# given in html_static_path.
html_style = 'default.css'
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = []
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
html_last_updated_fmt = '%b %d, %Y'
# If true, SmartyPants will be used to convert quotes and dashes to
# typographically correct entities.
html_use_smartypants = True
# Content template for the index page.
#html_index = ''
# Custom sidebar templates, maps document names to template names.
#html_sidebars = {}
# Additional templates that should be rendered to pages, maps page names to
# template names.
#html_additional_pages = {}
# If false, no module index is generated.
#html_use_modindex = True
# If true, the reST sources are included in the HTML build as _sources/<name>.
html_copy_source = True
# Output file base name for HTML help builder.
htmlhelp_basename = 'Djangodoc'
# Options for LaTeX output
# ------------------------
# The paper size ('letter' or 'a4').
#latex_paper_size = 'letter'
# The font size ('10pt', '11pt' or '12pt').
#latex_font_size = '10pt'
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, document class [howto/manual]).
#latex_documents = []
# Additional stuff for the LaTeX preamble.
#latex_preamble = ''
# Documents to append as an appendix to all manuals.
#latex_appendices = []
# If false, no module index is generated.
#latex_use_modindex = True

View File

@ -1306,9 +1306,6 @@ SQL equivalents::
Using raw strings (e.g., ``r'foo'`` instead of ``'foo'``) for passing in the
regular expression syntax is recommended.
Regular expression matching is not supported on the ``ado_mssql`` backend.
It will raise a ``NotImplementedError`` at runtime.
iregex
~~~~~~

View File

@ -338,7 +338,7 @@ Django offers many utility functions (particularly in ``django.utils``) that
take a string as their first argument and do something to that string. These
functions are used by template filters as well as directly in other code.
If you write your own similar functions and deal with translations, you'll
If you write your own similar functions and deal with translations, you'll
face the problem of what to do when the first argument is a lazy translation
object. You don't want to convert it to a string immediately, because you might
be using this function outside of a view (and hence the current thread's locale
@ -789,7 +789,7 @@ JavaScript that uses strings from different applications.
You can make the view dynamic by putting the packages into the URL pattern::
urlpatterns = patterns('',
(r'^jsi18n/(?P<packages>\S+?)/$, 'django.views.i18n.javascript_catalog'),
(r'^jsi18n/(?P<packages>\S+?)/$', 'django.views.i18n.javascript_catalog'),
)
With this, you specify the packages as a list of package names delimited by '+'
@ -811,24 +811,47 @@ interface to access it::
document.write(gettext('this is to be translated'));
There even is a ``ungettext`` interface and a string interpolation function::
There is also an ``ngettext`` interface::
d = {
count: 10
};
s = interpolate(ungettext('this is %(count)s object', 'this are %(count)s objects', d.count), d);
var object_cnt = 1 // or 0, or 2, or 3, ...
s = ngettext('literal for the singular case',
'literal for the plural case', object_cnt);
The ``interpolate`` function supports both positional interpolation and named
interpolation. So the above could have been written as::
and even a string interpolation function::
s = interpolate(ungettext('this is %s object', 'this are %s objects', 11), [11]);
function interpolate(fmt, obj, named);
The interpolation syntax is borrowed from Python. You shouldn't go over the top
with string interpolation, though: this is still JavaScript, so the code will
have to do repeated regular-expression substitutions. This isn't as fast as
string interpolation in Python, so keep it to those cases where you really
need it (for example, in conjunction with ``ungettext`` to produce proper
pluralizations).
The interpolation syntax is borrowed from Python, so the ``interpolate``
function supports both positional and named interpolation:
* Positional interpolation: ``obj`` contains a JavaScript Array object
whose elements values are then sequentially interpolated in their
corresponding ``fmt`` placeholders in the same order they appear.
For example::
fmts = ngettext('There is %s object. Remaining: %s',
'There are %s objects. Remaining: %s', 11);
s = interpolate(fmts, [11, 20]);
// s is 'There are 11 objects. Remaining: 20'
* Named interpolation: This mode is selected by passing the optional
boolean ``named`` parameter as true. ``obj`` contains a JavaScript
object or associative array. For example::
d = {
count: 10
total: 50
};
fmts = ngettext('Total: %(total)s, there is %(count)s object',
'there are %(count)s of a total of %(total)s objects', d.count);
s = interpolate(fmts, d, true);
You shouldn't go over the top with string interpolation, though: this is still
JavaScript, so the code has to make repeated regular-expression substitutions.
This isn't as fast as string interpolation in Python, so keep it to those
cases where you really need it (for example, in conjunction with ``ngettext``
to produce proper pluralizations).
Creating JavaScript translation catalogs
----------------------------------------

128
docs/index.txt Normal file
View File

@ -0,0 +1,128 @@
====================
Django Documentation
====================
The essential documentation
===========================
If you're new to Django, make sure to read the following documentation in
order.. The rest (in the "reference" section below) can be ready in any order as
you need various functionality.
.. toctree::
:maxdepth: 1
overview
install
tutorial01
tutorial02
tutorial03
tutorial04
faq
documentation
Reference
=========
.. toctree::
:maxdepth: 1
django-admin
model-api
db-api
transactions
templates
templates_python
newforms
modelforms
testing
sessions
cache
settings
url_dispatch
request_response
generic_views
authentication
shortcuts
unicode
pagination
serialization
i18n
middleware
custom_model_fields
databases
``django.contrib`` add-ons
--------------------------
.. toctree::
:maxdepth: 1
add_ons
contenttypes
csrf
databrowse
flatpages
form_preview
form_wizard
localflavor
redirects
sites
sitemaps
syndication_feeds
webdesign
Deployment
----------
.. toctree::
:maxdepth: 1
modpython
fastcgi
Solving specific problems
-------------------------
.. toctree::
:maxdepth: 1
apache_auth
static_files
email
legacy_databases
outputting_pdf
outputting_csv
Et cetera
---------
.. toctree::
:maxdepth: 1
design_philosophies
contributing
admin_css
api_stability
Release notes
-------------
.. toctree::
:maxdepth: 1
release_notes_0.96
release_notes_0.95
Also see the list of `backwards-incompatible changes`__ for changes made between
releases.
__ http://code.djangoproject.com/wiki/BackwardsIncompatibleChanges
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`

View File

@ -172,11 +172,11 @@ Installing the development version
If you decide to use the latest development version of Django,
you'll want to pay close attention to `the development timeline`_,
and you'll want to keep an eye on `the list of
backwards-incompatible changes`_; this will help you stay on top
backwards-incompatible changes`_. This will help you stay on top
of any new features you might want to use, as well as any changes
you'll need to make to your code when updating your copy of Django
(for stable releases, any necessary changes are documented in the
release notes).
you'll need to make to your code when updating your copy of Django.
(For stable releases, any necessary changes are documented in the
release notes.)
.. _the development timeline: http://code.djangoproject.com/timeline
.. _the list of backwards-incompatible changes: http://code.djangoproject.com/wiki/BackwardsIncompatibleChanges

View File

@ -236,7 +236,7 @@ works exactly the same way as any other ``newforms`` form. For
example, the ``is_valid()`` method is used to check for validity, the
``is_multipart()`` method is used to determine whether a form requires
multipart file upload (and hence whether ``request.FILES`` must be
passed to the form), etc.; see `the standard newforms documentation`_
passed to the form), etc. See `the standard newforms documentation`_
for more information.
.. _the standard newforms documentation: ../newforms/

View File

@ -1549,12 +1549,14 @@ additional required argument:
``ModelChoiceField``
~~~~~~~~~~~~~~~~~~~~
Allows the selection of a single model object, suitable for representing a
foreign key. The method receives an object as an argument and must return a
string to represent it.
Allows the selection of a single model object, suitable for
representing a foreign key.
The labels for the choice field call the ``__unicode__`` method of the model to
generate string representations. To provide custom labels, subclass ``ModelChoiceField`` and override ``label_for_model``::
The ``__unicode__`` method of the model will be called to generate
string representations of the objects for use in the field's choices;
to provide customized representations, subclass ``ModelChoiceField``
and override ``label_for_model``. This method will receive model
object, and should return a string suitable for representing it::
class MyModelChoiceField(ModelChoiceField):
def label_from_instance(self, obj):
@ -1563,9 +1565,10 @@ generate string representations. To provide custom labels, subclass ``ModelChoic
``ModelMultipleChoiceField``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Allows the selection of one or more model objects, suitable for representing a
many-to-many relation. As with ``ModelChoiceField``, you can use
``label_from_instance`` to customize the object labels.
Allows the selection of one or more model objects, suitable for
representing a many-to-many relation. As with ``ModelChoiceField``,
you can use ``label_from_instance`` to customize the object
representations.
Creating custom fields
----------------------

View File

@ -143,14 +143,13 @@ All attributes except ``session`` should be considered read-only.
``urlconf``
Not defined by Django itself, but will be read if other code
(e.g., a custom middleware class) sets it; when present, this will
be used as the root URLConf for the current request, overriding
(e.g., a custom middleware class) sets it. When present, this will
be used as the root URLconf for the current request, overriding
the ``ROOT_URLCONF`` setting. See `How Django processes a
request`_ for details.
.. _How Django processes a request: ../url_dispatch/#how-django-processes-a-request
Methods
-------
@ -202,19 +201,19 @@ Methods
``is_ajax()``
**New in Django development version**
Returns ``True`` if the request was made via an XMLHttpRequest by checking
the ``HTTP_X_REQUESTED_WITH`` header for the string *'XMLHttpRequest'*. The
following major Javascript libraries all send this header:
Returns ``True`` if the request was made via an ``XMLHttpRequest``, by checking
the ``HTTP_X_REQUESTED_WITH`` header for the string ``'XMLHttpRequest'``. The
following major JavaScript libraries all send this header:
* jQuery
* Dojo
* MochiKit
* MooTools
* Prototype
* YUI
* jQuery
* Dojo
* MochiKit
* MooTools
* Prototype
* YUI
If you write your own XMLHttpRequest call (on the browser side), you will
have to set this header manually to use this method.
If you write your own XMLHttpRequest call (on the browser side), you'll
have to set this header manually if you want ``is_ajax()`` to work.
QueryDict objects
-----------------

View File

@ -279,7 +279,7 @@ Default: ``''`` (Empty string)
The database backend to use. The build-in database backends are
``'postgresql_psycopg2'``, ``'postgresql'``, ``'mysql'``, ``'mysql_old'``,
``'sqlite3'``, ``'oracle'``, or ``'ado_mssql'``.
``'sqlite3'`` and ``'oracle'``.
In the Django development version, you can use a database backend that doesn't
ship with Django by setting ``DATABASE_ENGINE`` to a fully-qualified path (i.e.

View File

@ -250,7 +250,7 @@ request to the URL ``/rss/beats/0613/``:
will be an empty list. In our example, ``len(bits) != 1`` and an
``ObjectDoesNotExist`` exception will be raised, so ``/rss/beats/`` will
generate a 404 page. But you can handle this case however you like. For
example you could generate a combined feed for all beats.
example, you could generate a combined feed for all beats.
* To generate the feed's ``<title>``, ``<link>`` and ``<description>``,
Django uses the ``title()``, ``link()`` and ``description()`` methods. In

View File

@ -80,7 +80,7 @@ read Python's official documentation for the details.
.. admonition:: What's a **docstring**?
A good explanation of docstrings (and some guidelines for using them
effectively) can be found in :PEP:`257`:
effectively) can be found in :pep:`257`:
A docstring is a string literal that occurs as the first statement in
a module, function, class, or method definition. Such a docstring

View File

@ -37,9 +37,9 @@ A quick rundown:
form will alter data server-side. Whenever you create a form that alters
data server-side, use ``method="post"``. This tip isn't specific to
Django; it's just good Web development practice.
* ``forloop.counter`` indicates how many times the ``for`` tag has
gone through its loop; for more information, see `the
gone through its loop. For more information, see `the
documentation for the "for" tag`_.
.. _the documentation for the "for" tag: ../templates/#for
@ -247,8 +247,8 @@ template. Note that we use ``dict()`` to return an altered dictionary in place.
which is "lazy" and doesn't hit your database until it absolutely has to. By
the time the database query happens, the ``object_detail`` generic view will
have narrowed its scope down to a single object, so the eventual query will
only select one row from the database.
only select one row from the database.
If you'd like to know more about how that works, The Django database API
documentation `explains the lazy nature of QuerySet objects`_.
@ -266,9 +266,8 @@ from ``polls/views.py``. We don't need them anymore -- they have been replaced
by generic views.
The ``vote()`` view is still required. However, it must be modified to match
the new templates and context variables. Change the template call from
``polls/detail.html`` to ``polls/poll_detail.html``, and pass ``object`` in the
context instead of ``poll``.
the new context variables. In the ``render_to_repsonse()`` call, rename the
``poll`` context variable to ``object``.
The last thing to do is fix the URL handling to account for the use of generic
views. In the vote view above, we used the ``reverse()`` function to avoid
@ -276,7 +275,7 @@ hard-coding our URLs. Now that we've switched to a generic view, we'll need to
change the ``reverse()`` call to point back to our new generic view. We can't
simply use the view function anymore -- generic views can be (and are) used
multiple times -- but we can use the name we've given::
return HttpResponseRedirect(reverse('poll_results', args=(p.id,)))
Run the server, and use your new polling app based on generic views.

View File

@ -32,7 +32,7 @@ How Django processes a request
When a user requests a page from your Django-powered site, this is the
algorithm the system follows to determine which Python code to execute:
1. Django determines the root URLConf module to use; ordinarily
1. Django determines the root URLconf module to use. Ordinarily,
this is the value of the ``ROOT_URLCONF`` setting in your
`settings file`_, but if the incoming ``HttpRequest`` object
has an attribute called ``urlconf``, its value will be used in

View File

@ -92,7 +92,7 @@ __test__ = {'API_TESTS':"""
>>> Article.objects.filter(Q(headline__contains='bye'), headline__startswith='Hello')
[<Article: Hello and goodbye>]
# Try some arg queries with operations other than get_list
# Try some arg queries with operations other than filter.
>>> Article.objects.get(Q(headline__startswith='Hello'), Q(headline__contains='bye'))
<Article: Hello and goodbye>

View File

@ -1135,29 +1135,39 @@ u''
# FilePathField ###############################################################
>>> def fix_os_paths(x):
... if isinstance(x, basestring):
... return x.replace('\\', '/')
... elif isinstance(x, tuple):
... return tuple(fix_os_paths(list(x)))
... elif isinstance(x, list):
... return [fix_os_paths(y) for y in x]
... else:
... return x
...
>>> import os
>>> from django import newforms as forms
>>> path = forms.__file__
>>> path = os.path.dirname(path) + '/'
>>> path
>>> fix_os_paths(path)
'.../django/newforms/'
>>> f = forms.FilePathField(path=path)
>>> f.choices.sort()
>>> f.choices
>>> fix_os_paths(f.choices)
[('.../django/newforms/__init__.py', '__init__.py'), ('.../django/newforms/__init__.pyc', '__init__.pyc'), ('.../django/newforms/fields.py', 'fields.py'), ('.../django/newforms/fields.pyc', 'fields.pyc'), ('.../django/newforms/forms.py', 'forms.py'), ('.../django/newforms/forms.pyc', 'forms.pyc'), ('.../django/newforms/models.py', 'models.py'), ('.../django/newforms/models.pyc', 'models.pyc'), ('.../django/newforms/util.py', 'util.py'), ('.../django/newforms/util.pyc', 'util.pyc'), ('.../django/newforms/widgets.py', 'widgets.py'), ('.../django/newforms/widgets.pyc', 'widgets.pyc')]
>>> f.clean('fields.py')
Traceback (most recent call last):
...
ValidationError: [u'Select a valid choice. That choice is not one of the available choices.']
>>> f.clean(path + 'fields.py')
>>> fix_os_paths(f.clean(path + 'fields.py'))
u'.../django/newforms/fields.py'
>>> f = forms.FilePathField(path=path, match='^.*?\.py$')
>>> f.choices.sort()
>>> f.choices
>>> fix_os_paths(f.choices)
[('.../django/newforms/__init__.py', '__init__.py'), ('.../django/newforms/fields.py', 'fields.py'), ('.../django/newforms/forms.py', 'forms.py'), ('.../django/newforms/models.py', 'models.py'), ('.../django/newforms/util.py', 'util.py'), ('.../django/newforms/widgets.py', 'widgets.py')]
>>> f = forms.FilePathField(path=path, recursive=True, match='^.*?\.py$')
>>> f.choices.sort()
>>> f.choices
>>> fix_os_paths(f.choices)
[('.../django/newforms/__init__.py', '__init__.py'), ('.../django/newforms/extras/__init__.py', 'extras/__init__.py'), ('.../django/newforms/extras/widgets.py', 'extras/widgets.py'), ('.../django/newforms/fields.py', 'fields.py'), ('.../django/newforms/forms.py', 'forms.py'), ('.../django/newforms/models.py', 'models.py'), ('.../django/newforms/util.py', 'util.py'), ('.../django/newforms/widgets.py', 'widgets.py')]
# SplitDateTimeField ##########################################################

View File

@ -26,6 +26,9 @@ class Movie(models.Model):
movie_id = models.AutoField(primary_key=True)
name = models.CharField(max_length=60)
class Party(models.Model):
when = models.DateField()
__test__ = {'API_TESTS': """
(NOTE: Part of the regression test here is merely parsing the model
declaration. The verbose_name, in particular, did not always work.)
@ -51,5 +54,19 @@ u''
>>> len(a4.article_text)
5000
# #659 regression test
>>> import datetime
>>> p = Party.objects.create(when = datetime.datetime(1999, 12, 31))
>>> p = Party.objects.create(when = datetime.datetime(1998, 12, 31))
>>> p = Party.objects.create(when = datetime.datetime(1999, 1, 1))
>>> [p.when for p in Party.objects.filter(when__month = 2)]
[]
>>> [p.when for p in Party.objects.filter(when__month = 1)]
[datetime.date(1999, 1, 1)]
>>> [p.when for p in Party.objects.filter(when__month = 12)]
[datetime.date(1999, 12, 31), datetime.date(1998, 12, 31)]
>>> [p.when for p in Party.objects.filter(when__year = 1998)]
[datetime.date(1998, 12, 31)]
"""
}