1
0
mirror of https://github.com/django/django.git synced 2025-07-04 09:49:12 +00:00

[multi-db] Merge trunk to [3620]

git-svn-id: http://code.djangoproject.com/svn/django/branches/multiple-db-support@3621 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Jason Pellerin 2006-08-20 16:11:02 +00:00
parent bec235deef
commit f4a52d16b5
17 changed files with 293 additions and 282 deletions

View File

@ -68,6 +68,7 @@ answer newbie questions, and generally made Django that much better:
deric@monowerks.com deric@monowerks.com
dne@mayonnaise.net dne@mayonnaise.net
Jeremy Dunck <http://dunck.us/> Jeremy Dunck <http://dunck.us/>
Andy Dustman <farcepest@gmail.com>
Clint Ecker Clint Ecker
gandalf@owca.info gandalf@owca.info
Baishampayan Ghose Baishampayan Ghose

View File

@ -11,7 +11,7 @@ def compile_messages():
elif os.path.isdir('locale'): elif os.path.isdir('locale'):
basedir = os.path.abspath('locale') basedir = os.path.abspath('locale')
else: else:
print "this script should be run from the django svn tree or your project or app tree" print "This script should be run from the Django SVN tree or your project or app tree."
sys.exit(1) sys.exit(1)
for dirpath, dirnames, filenames in os.walk(basedir): for dirpath, dirnames, filenames in os.walk(basedir):
@ -19,7 +19,14 @@ def compile_messages():
if f.endswith('.po'): if f.endswith('.po'):
sys.stderr.write('processing file %s in %s\n' % (f, dirpath)) sys.stderr.write('processing file %s in %s\n' % (f, dirpath))
pf = os.path.splitext(os.path.join(dirpath, f))[0] pf = os.path.splitext(os.path.join(dirpath, f))[0]
cmd = 'msgfmt -o "%s.mo" "%s.po"' % (pf, pf) # Store the names of the .mo and .po files in an environment
# variable, rather than doing a string replacement into the
# command, so that we can take advantage of shell quoting, to
# quote any malicious characters/escaping.
# See http://cyberelk.net/tim/articles/cmdline/ar01s02.html
os.environ['djangocompilemo'] = pf + '.mo'
os.environ['djangocompilepo'] = pf + '.po'
cmd = 'msgfmt -o "$djangocompilemo" "$djangocompilepo"'
os.system(cmd) os.system(cmd)
if __name__ == "__main__": if __name__ == "__main__":

View File

@ -5,17 +5,21 @@
# #
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: django\n" "Project-Id-Version: django 0.95\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2006-05-16 10:11+0200\n" "POT-Creation-Date: 2006-05-16 10:11+0200\n"
"PO-Revision-Date: 2005-11-26 00:00\n" "PO-Revision-Date: 2006-08-14 18:08+0300\n"
"Last-Translator: Dmitry Sorokin <ds@dial.com.ru>\n" "Last-Translator: Grigory Fateyev <greg@dial.com.ru>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: Dialcom Services <greg@dial.com.ru>\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n" "Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"X-Poedit-Language: Russian\n"
"X-Poedit-Country: RUSSIAN FEDERATION\n"
"X-Poedit-SourceCharset: utf-8\n"
#: contrib/comments/models.py:67 contrib/comments/models.py:166 #: contrib/comments/models.py:67
#: contrib/comments/models.py:166
msgid "object ID" msgid "object ID"
msgstr "ID объекта" msgstr "ID объекта"
@ -23,7 +27,8 @@ msgstr "ID объекта"
msgid "headline" msgid "headline"
msgstr "заголовок" msgstr "заголовок"
#: contrib/comments/models.py:69 contrib/comments/models.py:90 #: contrib/comments/models.py:69
#: contrib/comments/models.py:90
#: contrib/comments/models.py:167 #: contrib/comments/models.py:167
msgid "comment" msgid "comment"
msgstr "комментарий" msgstr "комментарий"
@ -64,15 +69,18 @@ msgstr "рейтинг #8"
msgid "is valid rating" msgid "is valid rating"
msgstr "доступный рейтинг" msgstr "доступный рейтинг"
#: contrib/comments/models.py:83 contrib/comments/models.py:169 #: contrib/comments/models.py:83
#: contrib/comments/models.py:169
msgid "date/time submitted" msgid "date/time submitted"
msgstr "дата/время добавления" msgstr "дата/время добавления"
#: contrib/comments/models.py:84 contrib/comments/models.py:170 #: contrib/comments/models.py:84
#: contrib/comments/models.py:170
msgid "is public" msgid "is public"
msgstr "публичный" msgstr "публичный"
#: contrib/comments/models.py:85 contrib/admin/views/doc.py:289 #: contrib/comments/models.py:85
#: contrib/admin/views/doc.py:289
msgid "IP address" msgid "IP address"
msgstr "IP адрес" msgstr "IP адрес"
@ -81,19 +89,15 @@ msgid "is removed"
msgstr "удален" msgstr "удален"
#: contrib/comments/models.py:86 #: contrib/comments/models.py:86
msgid "" msgid "Check this box if the comment is inappropriate. A \"This comment has been removed\" message will be displayed instead."
"Check this box if the comment is inappropriate. A \"This comment has been " msgstr "Отметте, если комментарий нежелателен. Сообщение \"Этот комментарий был удалён\" будет показано взамен."
"removed\" message will be displayed instead."
msgstr ""
"Отметте, если комментарий нежелателен. Сообщение \"Этот комментарий был "
"удалён\" будет показано взамен."
#: contrib/comments/models.py:91 #: contrib/comments/models.py:91
#, fuzzy
msgid "comments" msgid "comments"
msgstr "комментарий" msgstr "комментарии"
#: contrib/comments/models.py:131 contrib/comments/models.py:207 #: contrib/comments/models.py:131
#: contrib/comments/models.py:207
msgid "Content object" msgid "Content object"
msgstr "Объект наполнения" msgstr "Объект наполнения"
@ -141,7 +145,6 @@ msgid "score date"
msgstr "счёт времени" msgstr "счёт времени"
#: contrib/comments/models.py:237 #: contrib/comments/models.py:237
#, fuzzy
msgid "karma score" msgid "karma score"
msgstr "Карма счёт" msgstr "Карма счёт"
@ -152,7 +155,7 @@ msgstr "Карма счета"
#: contrib/comments/models.py:242 #: contrib/comments/models.py:242
#, python-format #, python-format
msgid "%(score)d rating by %(user)s" msgid "%(score)d rating by %(user)s"
msgstr "" msgstr "%(score)d рейтинг %(user)s"
#: contrib/comments/models.py:258 #: contrib/comments/models.py:258
#, python-format #, python-format
@ -197,7 +200,7 @@ msgstr "Удаления модератором"
#: contrib/comments/models.py:285 #: contrib/comments/models.py:285
#, python-format #, python-format
msgid "Moderator deletion by %r" msgid "Moderator deletion by %r"
msgstr "" msgstr "Удаления модератора %r"
#: contrib/comments/views/karma.py:19 #: contrib/comments/views/karma.py:19
msgid "Anonymous users cannot vote" msgid "Anonymous users cannot vote"
@ -212,20 +215,17 @@ msgid "No voting for yourself"
msgstr "Нельзя голосовать за себя" msgstr "Нельзя голосовать за себя"
#: contrib/comments/views/comments.py:28 #: contrib/comments/views/comments.py:28
msgid "" msgid "This rating is required because you've entered at least one other rating."
"This rating is required because you've entered at least one other rating." msgstr "Этот рейтинг необходим, так как вы входили хоть однажды в другие рейтинги."
msgstr ""
#: contrib/comments/views/comments.py:112 #: contrib/comments/views/comments.py:112
#, python-format #, python-format
msgid "" msgid ""
"This comment was posted by a user who has posted fewer than %(count)s " "This comment was posted by a user who has posted fewer than %(count)s comment:\n"
"comment:\n"
"\n" "\n"
"%(text)s" "%(text)s"
msgid_plural "" msgid_plural ""
"This comment was posted by a user who has posted fewer than %(count)s " "This comment was posted by a user who has posted fewer than %(count)s comments:\n"
"comments:\n"
"\n" "\n"
"%(text)s" "%(text)s"
msgstr[0] "" msgstr[0] ""
@ -259,11 +259,8 @@ msgstr "Кто-то вмешивается в форму комментария
#: contrib/comments/views/comments.py:207 #: contrib/comments/views/comments.py:207
#: contrib/comments/views/comments.py:292 #: contrib/comments/views/comments.py:292
msgid "" msgid "The comment form had an invalid 'target' parameter -- the object ID was invalid"
"The comment form had an invalid 'target' parameter -- the object ID was " msgstr "Форма комментария имеет неверный 'target' параметр -- ID объекта неверно"
"invalid"
msgstr ""
"Форма комментария имеет неверный 'target' параметр -- ID объекта неверно"
#: contrib/comments/views/comments.py:257 #: contrib/comments/views/comments.py:257
#: contrib/comments/views/comments.py:321 #: contrib/comments/views/comments.py:321
@ -344,8 +341,11 @@ msgid ""
"<h3>By %s:</h3>\n" "<h3>By %s:</h3>\n"
"<ul>\n" "<ul>\n"
msgstr "" msgstr ""
"<h3>К %s:</h3>\n"
"<ul>\n"
#: contrib/admin/filterspecs.py:70 contrib/admin/filterspecs.py:88 #: contrib/admin/filterspecs.py:70
#: contrib/admin/filterspecs.py:88
#: contrib/admin/filterspecs.py:143 #: contrib/admin/filterspecs.py:143
msgid "All" msgid "All"
msgstr "Все" msgstr "Все"
@ -414,14 +414,11 @@ msgstr "журнальные записи"
msgid "All dates" msgid "All dates"
msgstr "Все даты" msgstr "Все даты"
#: contrib/admin/views/decorators.py:9 contrib/auth/forms.py:36 #: contrib/admin/views/decorators.py:9
#: contrib/auth/forms.py:36
#: contrib/auth/forms.py:41 #: contrib/auth/forms.py:41
msgid "" msgid "Please enter a correct username and password. Note that both fields are case-sensitive."
"Please enter a correct username and password. Note that both fields are case-" msgstr "Пожалуйста, вводите верные данные именя пользователя и пароль. Помните, оба поля чувствительны к регистру."
"sensitive."
msgstr ""
"Пожалуйста, вводите верные данные именя пользователя и пароль. Помните, оба "
"поля чувствительны к регистру."
#: contrib/admin/views/decorators.py:23 #: contrib/admin/views/decorators.py:23
#: contrib/admin/templates/admin/login.html:25 #: contrib/admin/templates/admin/login.html:25
@ -429,20 +426,12 @@ msgid "Log in"
msgstr "Вход" msgstr "Вход"
#: contrib/admin/views/decorators.py:61 #: contrib/admin/views/decorators.py:61
msgid "" msgid "Please log in again, because your session has expired. Don't worry: Your submission has been saved."
"Please log in again, because your session has expired. Don't worry: Your " msgstr "Пожалуйста войдите снова, посколькук ваша сессия устарела. Не беспокойтесь:введенные вами данные сохранены."
"submission has been saved."
msgstr ""
"Пожалуйста войдите снова, посколькук ваша сессия устарела. Не беспокойтесь:"
"введенные вами данные сохранены."
#: contrib/admin/views/decorators.py:68 #: contrib/admin/views/decorators.py:68
msgid "" msgid "Looks like your browser isn't configured to accept cookies. Please enable cookies, reload this page, and try again."
"Looks like your browser isn't configured to accept cookies. Please enable " msgstr "Похоже, что ваш броузер не настроен на прием cookies. Пожалуйства включите cookie, перезагрузите страницу и попытайтесь снова. "
"cookies, reload this page, and try again."
msgstr ""
"Похоже, что ваш броузер не настроен на прием cookies. Пожалуйства включите "
"cookie, перезагрузите страницу и попытайтесь снова. "
#: contrib/admin/views/decorators.py:82 #: contrib/admin/views/decorators.py:82
msgid "Usernames cannot contain the '@' character." msgid "Usernames cannot contain the '@' character."
@ -451,7 +440,7 @@ msgstr "Имя пользователя не может включать сим
#: contrib/admin/views/decorators.py:84 #: contrib/admin/views/decorators.py:84
#, python-format #, python-format
msgid "Your e-mail address is not your username. Try '%s' instead." msgid "Your e-mail address is not your username. Try '%s' instead."
msgstr "" msgstr "Ваш e-mail адрес не ваше имя. Попробуйте '%s' в замен."
#: contrib/admin/views/main.py:226 #: contrib/admin/views/main.py:226
msgid "Site administration" msgid "Site administration"
@ -462,11 +451,13 @@ msgstr "Администрирование сайта"
msgid "The %(name)s \"%(obj)s\" was added successfully." msgid "The %(name)s \"%(obj)s\" was added successfully."
msgstr "%(name)s \"%(obj)s\" были успешно добавлены." msgstr "%(name)s \"%(obj)s\" были успешно добавлены."
#: contrib/admin/views/main.py:264 contrib/admin/views/main.py:348 #: contrib/admin/views/main.py:264
#: contrib/admin/views/main.py:348
msgid "You may edit it again below." msgid "You may edit it again below."
msgstr "Вы снова можете редактировать их внизу" msgstr "Вы снова можете редактировать их внизу"
#: contrib/admin/views/main.py:272 contrib/admin/views/main.py:357 #: contrib/admin/views/main.py:272
#: contrib/admin/views/main.py:357
#, python-format #, python-format
msgid "You may add another %s below." msgid "You may add another %s below."
msgstr "Вы можете добавить %s внизу." msgstr "Вы можете добавить %s внизу."
@ -481,7 +472,8 @@ msgstr "Добавить %s"
msgid "Added %s." msgid "Added %s."
msgstr "Добавлено %s" msgstr "Добавлено %s"
#: contrib/admin/views/main.py:336 contrib/admin/views/main.py:338 #: contrib/admin/views/main.py:336
#: contrib/admin/views/main.py:338
#: contrib/admin/views/main.py:340 #: contrib/admin/views/main.py:340
msgid "and" msgid "and"
msgstr "и" msgstr "и"
@ -498,18 +490,17 @@ msgstr "Удалено %s."
#: contrib/admin/views/main.py:343 #: contrib/admin/views/main.py:343
msgid "No fields changed." msgid "No fields changed."
msgstr "" msgstr "Ни одно поле не изменено."
#: contrib/admin/views/main.py:346 #: contrib/admin/views/main.py:346
#, python-format #, python-format
msgid "The %(name)s \"%(obj)s\" was changed successfully." msgid "The %(name)s \"%(obj)s\" was changed successfully."
msgstr "" msgstr "%(name)s \"%(obj)s\" было успешно изменено"
#: contrib/admin/views/main.py:354 #: contrib/admin/views/main.py:354
#, python-format #, python-format
msgid "" msgid "The %(name)s \"%(obj)s\" was added successfully. You may edit it again below."
"The %(name)s \"%(obj)s\" was added successfully. You may edit it again below." msgstr "%(name)s \"%(obj)s\" было успешно изменено. Вы можете редактировать его снова."
msgstr ""
#: contrib/admin/views/main.py:392 #: contrib/admin/views/main.py:392
#, python-format #, python-format
@ -550,9 +541,12 @@ msgstr "Выберите %s"
msgid "Select %s to change" msgid "Select %s to change"
msgstr "Выберите %s для изменения" msgstr "Выберите %s для изменения"
#: contrib/admin/views/doc.py:277 contrib/admin/views/doc.py:286 #: contrib/admin/views/doc.py:277
#: contrib/admin/views/doc.py:288 contrib/admin/views/doc.py:294 #: contrib/admin/views/doc.py:286
#: contrib/admin/views/doc.py:295 contrib/admin/views/doc.py:297 #: contrib/admin/views/doc.py:288
#: contrib/admin/views/doc.py:294
#: contrib/admin/views/doc.py:295
#: contrib/admin/views/doc.py:297
msgid "Integer" msgid "Integer"
msgstr "Целое" msgstr "Целое"
@ -560,7 +554,8 @@ msgstr "Целое"
msgid "Boolean (Either True or False)" msgid "Boolean (Either True or False)"
msgstr "Логическое (True или False)" msgstr "Логическое (True или False)"
#: contrib/admin/views/doc.py:279 contrib/admin/views/doc.py:296 #: contrib/admin/views/doc.py:279
#: contrib/admin/views/doc.py:296
#, python-format #, python-format
msgid "String (up to %(maxlength)s)" msgid "String (up to %(maxlength)s)"
msgstr "Строка (до %(maxlength)s символов)" msgstr "Строка (до %(maxlength)s символов)"
@ -581,7 +576,8 @@ msgstr "Дата (с указанием времени)"
msgid "E-mail address" msgid "E-mail address"
msgstr "E-mail адрес" msgstr "E-mail адрес"
#: contrib/admin/views/doc.py:284 contrib/admin/views/doc.py:287 #: contrib/admin/views/doc.py:284
#: contrib/admin/views/doc.py:287
msgid "File path" msgid "File path"
msgstr "Путь к файлу" msgstr "Путь к файлу"
@ -595,7 +591,7 @@ msgstr "Логическое (True, False или None)"
#: contrib/admin/views/doc.py:292 #: contrib/admin/views/doc.py:292
msgid "Relation to parent model" msgid "Relation to parent model"
msgstr "" msgstr "Зависимость на родительскую модель."
#: contrib/admin/views/doc.py:293 #: contrib/admin/views/doc.py:293
msgid "Phone number" msgid "Phone number"
@ -609,7 +605,8 @@ msgstr "Текст"
msgid "Time" msgid "Time"
msgstr "Время" msgstr "Время"
#: contrib/admin/views/doc.py:300 contrib/flatpages/models.py:7 #: contrib/admin/views/doc.py:300
#: contrib/flatpages/models.py:7
msgid "URL" msgid "URL"
msgstr "URL" msgstr "URL"
@ -689,12 +686,8 @@ msgid "DATE_WITH_TIME_FULL"
msgstr "j. N Y, H:i" msgstr "j. N Y, H:i"
#: contrib/admin/templates/admin/object_history.html:36 #: contrib/admin/templates/admin/object_history.html:36
msgid "" msgid "This object doesn't have a change history. It probably wasn't added via this admin site."
"This object doesn't have a change history. It probably wasn't added via this " msgstr "Данный обьект не имеет истории изменения. Возможно он не был добавлен через данный административный сайт."
"admin site."
msgstr ""
"Данный обьект не имеет истории изменения. Возможно он не был добавлен через "
"данный административный сайт."
#: contrib/admin/templates/admin/base_site.html:4 #: contrib/admin/templates/admin/base_site.html:4
msgid "Django site admin" msgid "Django site admin"
@ -717,12 +710,8 @@ msgid "Server Error <em>(500)</em>"
msgstr "Ошибка сервера <em>(500)</em>" msgstr "Ошибка сервера <em>(500)</em>"
#: contrib/admin/templates/admin/500.html:10 #: contrib/admin/templates/admin/500.html:10
msgid "" msgid "There's been an error. It's been reported to the site administrators via e-mail and should be fixed shortly. Thanks for your patience."
"There's been an error. It's been reported to the site administrators via e-" msgstr "Произошла ошибка. Отчет об ошибке отправлен администраторам сайта по e-mailи она должна быть вскоре исправлена. Благодарим вас на терпение и помощь."
"mail and should be fixed shortly. Thanks for your patience."
msgstr ""
"Произошла ошибка. Отчет об ошибке отправлен администраторам сайта по e-mailи "
"она должна быть вскоре исправлена. Благодарим вас на терпение и помощь."
#: contrib/admin/templates/admin/404.html:4 #: contrib/admin/templates/admin/404.html:4
#: contrib/admin/templates/admin/404.html:8 #: contrib/admin/templates/admin/404.html:8
@ -736,7 +725,7 @@ msgstr "К сожалению, запрашиваемая вами страни
#: contrib/admin/templates/admin/index.html:17 #: contrib/admin/templates/admin/index.html:17
#, python-format #, python-format
msgid "Models available in the %(name)s application." msgid "Models available in the %(name)s application."
msgstr "Модели доступны в %(name) приложении." msgstr "Модели доступны в %(name)s приложении."
#: contrib/admin/templates/admin/index.html:28 #: contrib/admin/templates/admin/index.html:28
#: contrib/admin/templates/admin/change_form.html:15 #: contrib/admin/templates/admin/change_form.html:15
@ -783,23 +772,13 @@ msgstr "Удалить"
#: contrib/admin/templates/admin/delete_confirmation.html:14 #: contrib/admin/templates/admin/delete_confirmation.html:14
#, python-format #, python-format
msgid "" msgid "Deleting the %(object_name)s '%(object)s' would result in deleting related objects, but your account doesn't have permission to delete the following types of objects:"
"Deleting the %(object_name)s '%(object)s' would result in deleting related " msgstr "Удаление объекта %(object_name)s '%(object)s' приведет к удалению зависимых элементов, но предоставленных вам прав недостаточно для удаления следующих типов объектов:"
"objects, but your account doesn't have permission to delete the following "
"types of objects:"
msgstr ""
"Удаление объекта %(object_name)s '%(object)s' приведет к удалению зависимых "
"элементов, но предоставленных вам прав недостаточно для удаления следующих "
"типов объектов:"
#: contrib/admin/templates/admin/delete_confirmation.html:21 #: contrib/admin/templates/admin/delete_confirmation.html:21
#, python-format #, python-format
msgid "" msgid "Are you sure you want to delete the %(object_name)s \"%(object)s\"? All of the following related items will be deleted:"
"Are you sure you want to delete the %(object_name)s \"%(object)s\"? All of " msgstr "Вы уверены, что хотите удалить %(object_name)s \"%(object)s\"? Все следующие объекты также будут удалены:"
"the following related items will be deleted:"
msgstr ""
"Вы уверены, что хотите удалить %(object_name)s \"%(object)s\"? Все "
"следующие объекты также будут удалены:"
#: contrib/admin/templates/admin/delete_confirmation.html:26 #: contrib/admin/templates/admin/delete_confirmation.html:26
msgid "Yes, I'm sure" msgid "Yes, I'm sure"
@ -808,7 +787,7 @@ msgstr "Да, я уверен"
#: contrib/admin/templates/admin/filter.html:2 #: contrib/admin/templates/admin/filter.html:2
#, python-format #, python-format
msgid " By %(title)s " msgid " By %(title)s "
msgstr "" msgstr "К%(title)s "
#: contrib/admin/templates/admin/search_form.html:8 #: contrib/admin/templates/admin/search_form.html:8
msgid "Go" msgid "Go"
@ -872,12 +851,8 @@ msgid "Password reset"
msgstr "Сброс пароля" msgstr "Сброс пароля"
#: contrib/admin/templates/registration/password_reset_form.html:12 #: contrib/admin/templates/registration/password_reset_form.html:12
msgid "" msgid "Forgotten your password? Enter your e-mail address below, and we'll reset your password and e-mail the new one to you."
"Forgotten your password? Enter your e-mail address below, and we'll reset " msgstr "Забыли пароль? Введите ваш e-mail адрес ниже и мы очистим ваш старый пароль, и вышлем вам по e-mail новый."
"your password and e-mail the new one to you."
msgstr ""
"Забыли пароль? Введите ваш e-mail адрес ниже и мы очистим ваш старый пароль, "
"и вышлем вам по e-mail новый."
#: contrib/admin/templates/registration/password_reset_form.html:16 #: contrib/admin/templates/registration/password_reset_form.html:16
msgid "E-mail address:" msgid "E-mail address:"
@ -901,20 +876,12 @@ msgid "Password reset successful"
msgstr "Успешная очистка пароля" msgstr "Успешная очистка пароля"
#: contrib/admin/templates/registration/password_reset_done.html:12 #: contrib/admin/templates/registration/password_reset_done.html:12
msgid "" msgid "We've e-mailed a new password to the e-mail address you submitted. You should be receiving it shortly."
"We've e-mailed a new password to the e-mail address you submitted. You " msgstr "Мы отправили новый пароль по указанному вами адресу электронной почты. Вы должны его вскоре получить."
"should be receiving it shortly."
msgstr ""
"Мы отправили новый пароль по указанному вами адресу электронной почты. Вы "
"должны его вскоре получить."
#: contrib/admin/templates/registration/password_change_form.html:12 #: contrib/admin/templates/registration/password_change_form.html:12
msgid "" 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."
"Please enter your old password, for security's sake, and then enter your new " msgstr "В целях безопасности, пожалуйста, введите ваш старый пароль, затем - новый пароль дважды, с тем, чтобы мы могли убедиться в правильности написания."
"password twice so we can verify you typed it in correctly."
msgstr ""
"В целях безопасности, пожалуйста, введите ваш старый пароль, затем - новый "
"пароль дважды, с тем, чтобы мы могли убедиться в правильности написания."
#: contrib/admin/templates/registration/password_change_form.html:17 #: contrib/admin/templates/registration/password_change_form.html:17
msgid "Old password:" msgid "Old password:"
@ -987,24 +954,16 @@ msgid "Documentation for this page"
msgstr "Документация по данной странице" msgstr "Документация по данной странице"
#: contrib/admin/templates/admin_doc/bookmarklets.html:20 #: contrib/admin/templates/admin_doc/bookmarklets.html:20
msgid "" msgid "Jumps you from any page to the documentation for the view that generates that page."
"Jumps you from any page to the documentation for the view that generates " msgstr "Перенаправит вас с любой страницы к просмотру документа, который генерирует эту страницу."
"that page."
msgstr ""
"Перенаправит вас с любой страницы к просмотру документа, который генерирует "
"эту страницу."
#: contrib/admin/templates/admin_doc/bookmarklets.html:22 #: contrib/admin/templates/admin_doc/bookmarklets.html:22
msgid "Show object ID" msgid "Show object ID"
msgstr "Показать ID обьекта" msgstr "Показать ID обьекта"
#: contrib/admin/templates/admin_doc/bookmarklets.html:23 #: contrib/admin/templates/admin_doc/bookmarklets.html:23
msgid "" msgid "Shows the content-type and unique ID for pages that represent a single object."
"Shows the content-type and unique ID for pages that represent a single " msgstr "Показывает тип наполнения и уникальный ID для страниц, которые означают одинокий объект."
"object."
msgstr ""
"Показывает тип наполнения и уникальный ID для страниц, которые означают "
"одинокий объект."
#: contrib/admin/templates/admin_doc/bookmarklets.html:25 #: contrib/admin/templates/admin_doc/bookmarklets.html:25
msgid "Edit this object (current window)" msgid "Edit this object (current window)"
@ -1043,24 +1002,16 @@ msgid "redirect from"
msgstr "перенаправить из" msgstr "перенаправить из"
#: contrib/redirects/models.py:8 #: contrib/redirects/models.py:8
msgid "" msgid "This should be an absolute path, excluding the domain name. Example: '/events/search/'."
"This should be an absolute path, excluding the domain name. Example: '/" msgstr "Это должен быть абсолютный путь, исключая доменное имя. Пример: '/events/search/'."
"events/search/'."
msgstr ""
"Это должен быть абсолютный путь, исключая доменное имя. Пример: '/events/"
"search/'."
#: contrib/redirects/models.py:9 #: contrib/redirects/models.py:9
msgid "redirect to" msgid "redirect to"
msgstr "перенаправить на" msgstr "перенаправить на"
#: contrib/redirects/models.py:10 #: contrib/redirects/models.py:10
msgid "" msgid "This can be either an absolute path (as above) or a full URL starting with 'http://'."
"This can be either an absolute path (as above) or a full URL starting with " msgstr "Это должен быть, либо абсолютный путь (как выше) или полный URL начинающийся с 'http://'."
"'http://'."
msgstr ""
"Это должен быть, либо абсолютный путь (как выше) или полный URL начинающийся "
"с 'http://'."
#: contrib/redirects/models.py:12 #: contrib/redirects/models.py:12
msgid "redirect" msgid "redirect"
@ -1071,10 +1022,8 @@ msgid "redirects"
msgstr "перенаправления" msgstr "перенаправления"
#: contrib/flatpages/models.py:8 #: contrib/flatpages/models.py:8
msgid "" msgid "Example: '/about/contact/'. Make sure to have leading and trailing slashes."
"Example: '/about/contact/'. Make sure to have leading and trailing slashes." msgstr "Пример: '/about/contact/'. Будьте уверенны, что вставили завепршающий слэш."
msgstr ""
"Пример: '/about/contact/'. Будьте уверенны, что вставили завепршающий слэш."
#: contrib/flatpages/models.py:9 #: contrib/flatpages/models.py:9
msgid "title" msgid "title"
@ -1093,10 +1042,8 @@ msgid "template name"
msgstr "имя шаблона" msgstr "имя шаблона"
#: contrib/flatpages/models.py:13 #: contrib/flatpages/models.py:13
msgid "" msgid "Example: 'flatpages/contact_page'. If this isn't provided, the system will use 'flatpages/default'."
"Example: 'flatpages/contact_page'. If this isn't provided, the system will " msgstr "Пример: 'flatpages/contact_page'. Если этот файл не присутствует, система будет использовать 'flatpages/default'."
"use 'flatpages/default'."
msgstr ""
#: contrib/flatpages/models.py:14 #: contrib/flatpages/models.py:14
msgid "registration required" msgid "registration required"
@ -1114,7 +1061,8 @@ msgstr "простая страница"
msgid "flat pages" msgid "flat pages"
msgstr "простые страницы" msgstr "простые страницы"
#: contrib/auth/models.py:13 contrib/auth/models.py:26 #: contrib/auth/models.py:13
#: contrib/auth/models.py:26
msgid "name" msgid "name"
msgstr "имя" msgstr "имя"
@ -1126,7 +1074,8 @@ msgstr "код"
msgid "permission" msgid "permission"
msgstr "Права" msgstr "Права"
#: contrib/auth/models.py:18 contrib/auth/models.py:27 #: contrib/auth/models.py:18
#: contrib/auth/models.py:27
msgid "permissions" msgid "permissions"
msgstr "Права" msgstr "Права"
@ -1134,7 +1083,8 @@ msgstr "Права"
msgid "group" msgid "group"
msgstr "Группа" msgstr "Группа"
#: contrib/auth/models.py:30 contrib/auth/models.py:65 #: contrib/auth/models.py:30
#: contrib/auth/models.py:65
msgid "groups" msgid "groups"
msgstr "Группы" msgstr "Группы"
@ -1160,7 +1110,7 @@ msgstr "пароль"
#: contrib/auth/models.py:59 #: contrib/auth/models.py:59
msgid "Use '[algo]$[salt]$[hexdigest]'" msgid "Use '[algo]$[salt]$[hexdigest]'"
msgstr "" msgstr "Используйте '[algo]$[salt]$[hexdigest]'"
#: contrib/auth/models.py:60 #: contrib/auth/models.py:60
msgid "staff status" msgid "staff status"
@ -1187,12 +1137,8 @@ msgid "date joined"
msgstr "дата регистрации" msgstr "дата регистрации"
#: contrib/auth/models.py:66 #: contrib/auth/models.py:66
msgid "" msgid "In addition to the permissions manually assigned, this user will also get all permissions granted to each group he/she is in."
"In addition to the permissions manually assigned, this user will also get " msgstr "К добавлению к перавам выбрнанным вуручную, этот пользователь может получить все права группы, к которой он принадлежит."
"all permissions granted to each group he/she is in."
msgstr ""
"К добавлению к перавам выбрнанным вуручную, этот пользователь может получить "
"все права группы, к которой он принадлежит."
#: contrib/auth/models.py:67 #: contrib/auth/models.py:67
msgid "user permissions" msgid "user permissions"
@ -1227,10 +1173,8 @@ msgid "message"
msgstr "Сообщение" msgstr "Сообщение"
#: contrib/auth/forms.py:30 #: contrib/auth/forms.py:30
msgid "" msgid "Your Web browser doesn't appear to have cookies enabled. Cookies are required for logging in."
"Your Web browser doesn't appear to have cookies enabled. Cookies are " msgstr "У вашего браузера не включены cookies. Cookies необходимы для входа."
"required for logging in."
msgstr ""
#: contrib/contenttypes/models.py:25 #: contrib/contenttypes/models.py:25
msgid "python model class name" msgid "python model class name"
@ -1328,23 +1272,28 @@ msgstr "Январь"
msgid "February" msgid "February"
msgstr "Февраль" msgstr "Февраль"
#: utils/dates.py:14 utils/dates.py:27 #: utils/dates.py:14
#: utils/dates.py:27
msgid "March" msgid "March"
msgstr "Март" msgstr "Март"
#: utils/dates.py:14 utils/dates.py:27 #: utils/dates.py:14
#: utils/dates.py:27
msgid "April" msgid "April"
msgstr "Апрель" msgstr "Апрель"
#: utils/dates.py:14 utils/dates.py:27 #: utils/dates.py:14
#: utils/dates.py:27
msgid "May" msgid "May"
msgstr "Май" msgstr "Май"
#: utils/dates.py:14 utils/dates.py:27 #: utils/dates.py:14
#: utils/dates.py:27
msgid "June" msgid "June"
msgstr "Июнь" msgstr "Июнь"
#: utils/dates.py:15 utils/dates.py:27 #: utils/dates.py:15
#: utils/dates.py:27
msgid "July" msgid "July"
msgstr "Июль" msgstr "Июль"
@ -1593,11 +1542,8 @@ msgid "This value must contain only letters, numbers and underscores."
msgstr "Значение может содержать только буквы, цифры и подчеркивания." msgstr "Значение может содержать только буквы, цифры и подчеркивания."
#: core/validators.py:64 #: core/validators.py:64
msgid "" msgid "This value must contain only letters, numbers, underscores, dashes or slashes."
"This value must contain only letters, numbers, underscores, dashes or " msgstr "Значение может содержать только буквы, цифры, подчеркивания, дифисы или тере."
"slashes."
msgstr "Значение может содержать только буквы, цифры, подчеркивания, дифисы или "
"тере."
#: core/validators.py:72 #: core/validators.py:72
msgid "Uppercase letters are not allowed here." msgid "Uppercase letters are not allowed here."
@ -1647,7 +1593,8 @@ msgstr "Вводите реальную дату в формате YYYY-MM-DD."
msgid "Enter a valid time in HH:MM format." msgid "Enter a valid time in HH:MM format."
msgstr "Вводите реальное время в формате HH:MM." msgstr "Вводите реальное время в формате HH:MM."
#: core/validators.py:132 db/models/fields/__init__.py:468 #: core/validators.py:132
#: db/models/fields/__init__.py:468
msgid "Enter a valid date/time in YYYY-MM-DD HH:MM format." msgid "Enter a valid date/time in YYYY-MM-DD HH:MM format."
msgstr "Вводите реальные дата/время в формате YYYY-MM-DD HH:MM." msgstr "Вводите реальные дата/время в формате YYYY-MM-DD HH:MM."
@ -1656,12 +1603,8 @@ msgid "Enter a valid e-mail address."
msgstr "Укажите реальный e-mail адрес." msgstr "Укажите реальный e-mail адрес."
#: core/validators.py:148 #: core/validators.py:148
msgid "" msgid "Upload a valid image. The file you uploaded was either not an image or a corrupted image."
"Upload a valid image. The file you uploaded was either not an image or a " msgstr "Загрузите реальное изображение. Файл, который вы загружали, не был изображением или был поврежден."
"corrupted image."
msgstr ""
"Загрузите реальное изображение. Файл, который вы загружали, не был "
"изображением или был поврежден."
#: core/validators.py:155 #: core/validators.py:155
#, python-format #, python-format
@ -1701,7 +1644,8 @@ msgstr "Неверный формат XML: %s"
msgid "Invalid URL: %s" msgid "Invalid URL: %s"
msgstr "Неверный URL: %s" msgstr "Неверный URL: %s"
#: core/validators.py:206 core/validators.py:208 #: core/validators.py:206
#: core/validators.py:208
#, python-format #, python-format
msgid "The URL %s is a broken link." msgid "The URL %s is a broken link."
msgstr "URL %s сломанная ссылка." msgstr "URL %s сломанная ссылка."
@ -1726,7 +1670,8 @@ msgstr "Это поле должно совпадать с полем '%s'."
msgid "Please enter something for at least one field." msgid "Please enter something for at least one field."
msgstr "Пожалуйста, заполните хотя бы одно поле." msgstr "Пожалуйста, заполните хотя бы одно поле."
#: core/validators.py:264 core/validators.py:275 #: core/validators.py:264
#: core/validators.py:275
msgid "Please enter both fields or leave them both empty." msgid "Please enter both fields or leave them both empty."
msgstr "Пожалуйста, заполните оба поля либо оставьте их пустыми." msgstr "Пожалуйста, заполните оба поля либо оставьте их пустыми."
@ -1756,26 +1701,16 @@ msgstr "Пожалуйста, вводите корректное десятич
#: core/validators.py:349 #: core/validators.py:349
#, python-format #, python-format
msgid "Please enter a valid decimal number with at most %s total digit." msgid "Please enter a valid decimal number with at most %s total digit."
msgid_plural "" msgid_plural "Please enter a valid decimal number with at most %s total digits."
"Please enter a valid decimal number with at most %s total digits." msgstr[0] "Пожалуйста, вводите корректное десятичное число с максимальным количеством знаков %s."
msgstr[0] "" msgstr[1] "Пожалуйста, вводите корректное десятичное число с максимальным количеством знаков %s."
"Пожалуйста, вводите корректное десятичное число с максимальным количеством "
"знаков %s."
msgstr[1] ""
"Пожалуйста, вводите корректное десятичное число с максимальным количеством "
"знаков %s."
#: core/validators.py:352 #: core/validators.py:352
#, python-format #, python-format
msgid "Please enter a valid decimal number with at most %s decimal place." msgid "Please enter a valid decimal number with at most %s decimal place."
msgid_plural "" msgid_plural "Please enter a valid decimal number with at most %s decimal places."
"Please enter a valid decimal number with at most %s decimal places." msgstr[0] "Пожалуйста, вводите корректное десятичное число с максимальным количеством знаков после запятой %s."
msgstr[0] "" msgstr[1] "Пожалуйста, вводите корректное десятичное число с максимальным количеством знаков после запятой %s."
"Пожалуйста, вводите корректное десятичное число с максимальным количеством "
"знаков после запятой %s."
msgstr[1] ""
"Пожалуйста, вводите корректное десятичное число с максимальным количеством "
"знаков после запятой %s."
#: core/validators.py:362 #: core/validators.py:362
#, python-format #, python-format
@ -1802,50 +1737,37 @@ msgstr "Невозможно получить что-либо с %s."
#: core/validators.py:429 #: core/validators.py:429
#, python-format #, python-format
msgid "" msgid "The URL %(url)s returned the invalid Content-Type header '%(contenttype)s'."
"The URL %(url)s returned the invalid Content-Type header '%(contenttype)s'." msgstr "URL %(url)s вернул неверный заголовок Content-Type '%(contenttype)s'."
msgstr "URL %(url) вернул неверный заголовок Content-Type '%(contenttype)'."
#: core/validators.py:462 #: core/validators.py:462
#, python-format #, python-format
msgid "" msgid "Please close the unclosed %(tag)s tag from line %(line)s. (Line starts with \"%(start)s\".)"
"Please close the unclosed %(tag)s tag from line %(line)s. (Line starts with "
"\"%(start)s\".)"
msgstr "" msgstr ""
#: core/validators.py:466 #: core/validators.py:466
#, python-format #, python-format
msgid "" msgid "Some text starting on line %(line)s is not allowed in that context. (Line starts with \"%(start)s\".)"
"Some text starting on line %(line)s is not allowed in that context. (Line "
"starts with \"%(start)s\".)"
msgstr "" msgstr ""
#: core/validators.py:471 #: core/validators.py:471
#, python-format #, python-format
msgid "" msgid "\"%(attr)s\" on line %(line)s is an invalid attribute. (Line starts with \"%(start)s\".)"
"\"%(attr)s\" on line %(line)s is an invalid attribute. (Line starts with \"%"
"(start)s\".)"
msgstr "" msgstr ""
#: core/validators.py:476 #: core/validators.py:476
#, python-format #, python-format
msgid "" msgid "\"<%(tag)s>\" on line %(line)s is an invalid tag. (Line starts with \"%(start)s\".)"
"\"<%(tag)s>\" on line %(line)s is an invalid tag. (Line starts with \"%"
"(start)s\".)"
msgstr "" msgstr ""
#: core/validators.py:480 #: core/validators.py:480
#, python-format #, python-format
msgid "" msgid "A tag on line %(line)s is missing one or more required attributes. (Line starts with \"%(start)s\".)"
"A tag on line %(line)s is missing one or more required attributes. (Line "
"starts with \"%(start)s\".)"
msgstr "" msgstr ""
#: core/validators.py:485 #: core/validators.py:485
#, python-format #, python-format
msgid "" msgid "The \"%(attr)s\" attribute on line %(line)s has an invalid value. (Line starts with \"%(start)s\".)"
"The \"%(attr)s\" attribute on line %(line)s has an invalid value. (Line "
"starts with \"%(start)s\".)"
msgstr "" msgstr ""
#: db/models/manipulators.py:302 #: db/models/manipulators.py:302
@ -1858,8 +1780,10 @@ msgstr ""
msgid "%(optname)s with this %(fieldname)s already exists." msgid "%(optname)s with this %(fieldname)s already exists."
msgstr "" msgstr ""
#: db/models/fields/__init__.py:114 db/models/fields/__init__.py:265 #: db/models/fields/__init__.py:114
#: db/models/fields/__init__.py:542 db/models/fields/__init__.py:553 #: db/models/fields/__init__.py:265
#: db/models/fields/__init__.py:542
#: db/models/fields/__init__.py:553
#: forms/__init__.py:346 #: forms/__init__.py:346
msgid "This field is required." msgid "This field is required."
msgstr "Обязательное поле." msgstr "Обязательное поле."
@ -1869,14 +1793,12 @@ msgid "This value must be an integer."
msgstr "" msgstr ""
#: db/models/fields/__init__.py:369 #: db/models/fields/__init__.py:369
#, fuzzy
msgid "This value must be either True or False." msgid "This value must be either True or False."
msgstr "Логическое (True или False)" msgstr "Значение должно либо True либо False."
#: db/models/fields/__init__.py:385 #: db/models/fields/__init__.py:385
#, fuzzy
msgid "This field cannot be null." msgid "This field cannot be null."
msgstr "Это поле неверно." msgstr "Это поле не может быть нулевым."
#: db/models/fields/__init__.py:562 #: db/models/fields/__init__.py:562
msgid "Enter a valid filename." msgid "Enter a valid filename."
@ -1888,23 +1810,17 @@ msgid "Please enter a valid %s."
msgstr "" msgstr ""
#: db/models/fields/related.py:579 #: db/models/fields/related.py:579
#, fuzzy
msgid "Separate multiple IDs with commas." msgid "Separate multiple IDs with commas."
msgstr "Несколько значений ID разделяйте запятыми." msgstr "Несколько значений ID разделяйте запятыми."
#: db/models/fields/related.py:581 #: db/models/fields/related.py:581
#, fuzzy msgid "Hold down \"Control\", or \"Command\" on a Mac, to select more than one."
msgid "" msgstr " Удерживайте \"Control\", или \"Command\" на Макинтош, для выбора больше чем одного."
"Hold down \"Control\", or \"Command\" on a Mac, to select more than one."
msgstr ""
" Удерживайте \"Control\", или \"Command\" на Макинтош, для выбора больше чем "
"одного."
#: db/models/fields/related.py:625 #: db/models/fields/related.py:625
#, python-format #, python-format
msgid "Please enter valid %(self)s IDs. The value %(value)r is invalid." msgid "Please enter valid %(self)s IDs. The value %(value)r is invalid."
msgid_plural "" msgid_plural "Please enter valid %(self)s IDs. The values %(value)r are invalid."
"Please enter valid %(self)s IDs. The values %(value)r are invalid."
msgstr[0] "" msgstr[0] ""
msgstr[1] "" msgstr[1] ""
@ -1919,7 +1835,9 @@ msgstr[1] ""
msgid "Line breaks are not allowed here." msgid "Line breaks are not allowed here."
msgstr "Переносы строк не допускаются здесь." msgstr "Переносы строк не допускаются здесь."
#: forms/__init__.py:480 forms/__init__.py:551 forms/__init__.py:589 #: forms/__init__.py:480
#: forms/__init__.py:551
#: forms/__init__.py:589
#, python-format #, python-format
msgid "Select a valid choice; '%(data)s' is not in %(choices)s." msgid "Select a valid choice; '%(data)s' is not in %(choices)s."
msgstr "" msgstr ""
@ -1944,30 +1862,3 @@ msgstr "Введите целое число в диапазоне от 0 до 3
msgid "yes,no,maybe" msgid "yes,no,maybe"
msgstr "да,нет,может быть" msgstr "да,нет,может быть"
#~ msgid "Comment"
#~ msgstr "Комментарий"
#~ msgid "Comments"
#~ msgstr "Комментарии"
#~ msgid "label"
#~ msgstr "метка"
#~ msgid "package"
#~ msgstr "пакет"
#~ msgid "packages"
#~ msgstr "пакеты"
#~ msgid "String (up to 50)"
#~ msgstr "Строка (до 50 символов)"
#~ msgid ""
#~ "Example: 'flatfiles/contact_page'. If this isn't provided, the system "
#~ "will use 'flatfiles/default'."
#~ msgstr ""
#~ "Пример: 'flatfiles/contact_page'. Если не предусмотрена, система будет "
#~ "использовать 'flatfiles/default'."
#~ msgid "Server error <em>(500)</em>"
#~ msgstr "Ошибка сервера <em>(500)</em>"

View File

@ -27,6 +27,10 @@ LANGUAGE_CODE = 'en-us'
SITE_ID = 1 SITE_ID = 1
# If you set this to False, Django will make some optimizations so as not
# to load the internationalization machinery.
USE_I18N = True
# Absolute path to the directory that holds media. # Absolute path to the directory that holds media.
# Example: "/home/media/media.lawrence.com/" # Example: "/home/media/media.lawrence.com/"
MEDIA_ROOT = '' MEDIA_ROOT = ''

View File

@ -6,6 +6,7 @@
{% if LANGUAGE_BIDI %}<link rel="stylesheet" type="text/css" href="{% block stylesheet_rtl %}{% admin_media_prefix %}css/rtl.css{% endblock %}" />{% endif %} {% if LANGUAGE_BIDI %}<link rel="stylesheet" type="text/css" href="{% block stylesheet_rtl %}{% admin_media_prefix %}css/rtl.css{% endblock %}" />{% endif %}
{% block extrastyle %}{% endblock %} {% block extrastyle %}{% endblock %}
{% block extrahead %}{% endblock %} {% block extrahead %}{% endblock %}
{% block blockbots %}<meta name="robots" content="NONE,NOARCHIVE" />{% endblock %}
</head> </head>
{% load i18n %} {% load i18n %}

View File

@ -226,7 +226,7 @@ def model_detail(request, app_label, model_name):
return render_to_response('admin_doc/model_detail.html', { return render_to_response('admin_doc/model_detail.html', {
'name': '%s.%s' % (opts.app_label, opts.object_name), 'name': '%s.%s' % (opts.app_label, opts.object_name),
'summary': "Fields on %s objects" % opts.object_name, 'summary': _("Fields on %s objects") % opts.object_name,
'description': model.__doc__, 'description': model.__doc__,
'fields': fields, 'fields': fields,
}, context_instance=RequestContext(request)) }, context_instance=RequestContext(request))

View File

@ -263,7 +263,9 @@ def add_stage(request, app_label, model_name, show_delete=False, form_url='', po
post_url_continue += "?_popup=1" post_url_continue += "?_popup=1"
return HttpResponseRedirect(post_url_continue % pk_value) return HttpResponseRedirect(post_url_continue % pk_value)
if request.POST.has_key("_popup"): if request.POST.has_key("_popup"):
return HttpResponse('<script type="text/javascript">opener.dismissAddAnotherPopup(window, %r, "%s");</script>' % \ if type(pk_value) is str: # Quote if string, so JavaScript doesn't think it's a variable.
pk_value = '"%s"' % pk_value.replace('"', '\\"')
return HttpResponse('<script type="text/javascript">opener.dismissAddAnotherPopup(window, %s, "%s");</script>' % \
(pk_value, str(new_object).replace('"', '\\"'))) (pk_value, str(new_object).replace('"', '\\"')))
elif request.POST.has_key("_addanother"): elif request.POST.has_key("_addanother"):
request.user.message_set.create(message=msg + ' ' + (_("You may add another %s below.") % opts.verbose_name)) request.user.message_set.create(message=msg + ' ' + (_("You may add another %s below.") % opts.verbose_name))
@ -711,9 +713,19 @@ class ChangeList(object):
qs = qs.order_by((self.order_type == 'desc' and '-' or '') + lookup_order_field) qs = qs.order_by((self.order_type == 'desc' and '-' or '') + lookup_order_field)
# Apply keyword searches. # Apply keyword searches.
def construct_search(field_name):
if field_name.startswith('^'):
return "%s__istartswith" % field_name[1:]
elif field_name.startswith('='):
return "%s__iexact" % field_name[1:]
elif field_name.startswith('@'):
return "%s__search" % field_name[1:]
else:
return "%s__icontains" % field_name
if self.lookup_opts.admin.search_fields and self.query: if self.lookup_opts.admin.search_fields and self.query:
for bit in self.query.split(): for bit in self.query.split():
or_queries = [models.Q(**{'%s__icontains' % field_name: bit}) for field_name in self.lookup_opts.admin.search_fields] or_queries = [models.Q(**{construct_search(field_name): bit}) for field_name in self.lookup_opts.admin.search_fields]
other_qs = QuerySet(self.model) other_qs = QuerySet(self.model)
other_qs = other_qs.filter(reduce(operator.or_, or_queries)) other_qs = other_qs.filter(reduce(operator.or_, or_queries))
qs = qs & other_qs qs = qs & other_qs

View File

@ -20,7 +20,7 @@ class CacheClass(BaseCache):
return val return val
def set(self, key, value, timeout=0): def set(self, key, value, timeout=0):
self._cache.set(key, value, timeout) self._cache.set(key, value, timeout or self.default_timeout)
def delete(self, key): def delete(self, key):
self._cache.delete(key) self._cache.delete(key)

View File

@ -41,6 +41,9 @@ class CacheMiddleware(object):
def process_request(self, request): def process_request(self, request):
"Checks whether the page is already cached and returns the cached version if available." "Checks whether the page is already cached and returns the cached version if available."
if self.cache_anonymous_only:
assert hasattr(request, 'user'), "The Django cache middleware with CACHE_MIDDLEWARE_ANONYMOUS_ONLY=True requires authentication middleware to be installed. Edit your MIDDLEWARE_CLASSES setting to insert 'django.contrib.auth.middleware.AuthenticationMiddleware' before the CacheMiddleware."
if not request.method in ('GET', 'HEAD') or request.GET: if not request.method in ('GET', 'HEAD') or request.GET:
request._cache_update_cache = False request._cache_update_cache = False
return None # Don't bother checking the cache. return None # Don't bother checking the cache.

View File

@ -35,3 +35,27 @@ class ConditionalGetMiddleware(object):
response.content = '' response.content = ''
return response return response
class SetRemoteAddrFromForwardedFor(object):
"""
Middleware that sets REMOTE_ADDR based on HTTP_X_FORWARDED_FOR, if the
latter is set. This is useful if you're sitting behind a reverse proxy that
causes each request's REMOTE_ADDR to be set to 127.0.0.1.
Note that this does NOT validate HTTP_X_FORWARDED_FOR. If you're not behind
a reverse proxy that sets HTTP_X_FORWARDED_FOR automatically, do not use
this middleware. Anybody can spoof the value of HTTP_X_FORWARDED_FOR, and
because this sets REMOTE_ADDR based on HTTP_X_FORWARDED_FOR, that means
anybody can "fake" their IP address. Only use this when you can absolutely
trust the value of HTTP_X_FORWARDED_FOR.
"""
def process_request(self, request):
try:
real_ip = request.META['HTTP_X_FORWARDED_FOR']
except KeyError:
return None
else:
# HTTP_X_FORWARDED_FOR can be a comma-separated list of IPs.
# Take just the first one.
real_ip = real_ip.split(",")[0]
request.META['REMOTE_ADDR'] = real_ip

View File

@ -233,7 +233,10 @@ The cache middleware caches every page that doesn't have GET or POST
parameters. Optionally, if the ``CACHE_MIDDLEWARE_ANONYMOUS_ONLY`` setting is parameters. Optionally, if the ``CACHE_MIDDLEWARE_ANONYMOUS_ONLY`` setting is
``True``, only anonymous requests (i.e., not those made by a logged-in user) ``True``, only anonymous requests (i.e., not those made by a logged-in user)
will be cached. This is a simple and effective way of disabling caching for any will be cached. This is a simple and effective way of disabling caching for any
user-specific pages (include Django's admin interface). user-specific pages (include Django's admin interface). Note that if you use
``CACHE_MIDDLEWARE_ANONYMOUS_ONLY``, you should make sure you've activated
``AuthenticationMiddleware`` and that ``AuthenticationMiddleware`` appears
before ``CacheMiddleware`` in your ``MIDDLEWARE_CLASSES``.
Additionally, ``CacheMiddleware`` automatically sets a few headers in each Additionally, ``CacheMiddleware`` automatically sets a few headers in each
``HttpResponse``: ``HttpResponse``:

View File

@ -98,11 +98,10 @@ Lawrence, Kansas, USA.
On IRC, Simon goes by ``SimonW``. On IRC, Simon goes by ``SimonW``.
`Wilson Miner`_ `Wilson Miner`_
Wilson's design-fu makes us all look like rock stars. When not sneaking Wilson's design-fu makes us all look like rock stars. By day, he's an
into apartment complex swimming pools, he's the Commercial Development interactive designer for `Apple`. Don't ask him what he's working on, or
Director for World Online, which means he makes the money that pays all our he'll have to kill you. He lives in San Francisco.
paychecks. He lives in Lawrence, Kansas.
On IRC, Wilson goes by ``wilsonian``. On IRC, Wilson goes by ``wilsonian``.
.. _`World Online`: http://code.djangoproject.com/wiki/WorldOnline .. _`World Online`: http://code.djangoproject.com/wiki/WorldOnline
@ -113,6 +112,7 @@ Lawrence, Kansas, USA.
.. _`simon.incutio.com`: http://simon.incutio.com/ .. _`simon.incutio.com`: http://simon.incutio.com/
.. _`Jacob Kaplan-Moss`: http://www.jacobian.org/ .. _`Jacob Kaplan-Moss`: http://www.jacobian.org/
.. _`Wilson Miner`: http://www.wilsonminer.com/ .. _`Wilson Miner`: http://www.wilsonminer.com/
.. _`Apple`: http://www.apple.com/
Which sites use Django? Which sites use Django?
----------------------- -----------------------

View File

@ -48,9 +48,10 @@ bit of i18n-related overhead in certain places of the framework. If you don't
use internationalization, you should take the two seconds to set use internationalization, you should take the two seconds to set
``USE_I18N = False`` in your settings file. If ``USE_I18N`` is set to ``USE_I18N = False`` in your settings file. If ``USE_I18N`` is set to
``False``, then Django will make some optimizations so as not to load the ``False``, then Django will make some optimizations so as not to load the
internationalization machinery. internationalization machinery. See the `documentation for USE_I18N`_.
See the `documentation for USE_I18N`_. You'll probably also want to remove ``'django.core.context_processors.i18n'``
from your ``TEMPLATE_CONTEXT_PROCESSORS`` setting.
.. _documentation for USE_I18N: http://www.djangoproject.com/documentation/settings/#use-i18n .. _documentation for USE_I18N: http://www.djangoproject.com/documentation/settings/#use-i18n

View File

@ -63,7 +63,7 @@ Adds a few conveniences for perfectionists:
last component in the path contains a period. So ``foo.com/bar`` is last component in the path contains a period. So ``foo.com/bar`` is
redirected to ``foo.com/bar/``, but ``foo.com/bar/file.txt`` is passed redirected to ``foo.com/bar/``, but ``foo.com/bar/file.txt`` is passed
through unchanged. through unchanged.
If ``PREPEND_WWW`` is ``True``, URLs that lack a leading "www." will be If ``PREPEND_WWW`` is ``True``, URLs that lack a leading "www." will be
redirected to the same URL with a leading "www." redirected to the same URL with a leading "www."
@ -101,6 +101,22 @@ Handles conditional GET operations. If the response has a ``ETag`` or
Also removes the content from any response to a HEAD request and sets the Also removes the content from any response to a HEAD request and sets the
``Date`` and ``Content-Length`` response-headers. ``Date`` and ``Content-Length`` response-headers.
django.middleware.http.SetRemoteAddrFromForwardedFor
----------------------------------------------------
**New in Django development version**
Sets ``request['REMOTE_ADDR']`` based on ``request.['HTTP_X_FORWARDED_FOR']``,
if the latter is set. This is useful if you're sitting behind a reverse proxy
that causes each request's ``REMOTE_ADDR`` to be set to ``127.0.0.1``.
**Important note:** This does NOT validate ``HTTP_X_FORWARDED_FOR``. If you're
not behind a reverse proxy that sets ``HTTP_X_FORWARDED_FOR`` automatically, do
not use this middleware. Anybody can spoof the value of
``HTTP_X_FORWARDED_FOR``, and because this sets ``REMOTE_ADDR`` based on
``HTTP_X_FORWARDED_FOR``, that means anybody can "fake" their IP address. Only
use this when you can absolutely trust the value of ``HTTP_X_FORWARDED_FOR``.
django.contrib.sessions.middleware.SessionMiddleware django.contrib.sessions.middleware.SessionMiddleware
---------------------------------------------------- ----------------------------------------------------

View File

@ -217,7 +217,7 @@ steps:
subdirectory of ``MEDIA_ROOT`` it should upload files. subdirectory of ``MEDIA_ROOT`` it should upload files.
3. All that will be stored in your database is a path to the file 3. All that will be stored in your database is a path to the file
(relative to ``MEDIA_ROOT``). You'll must likely want to use the (relative to ``MEDIA_ROOT``). You'll most likely want to use the
convenience ``get_<fieldname>_url`` function provided by Django. For convenience ``get_<fieldname>_url`` function provided by Django. For
example, if your ``ImageField`` is called ``mug_shot``, you can get example, if your ``ImageField`` is called ``mug_shot``, you can get
the absolute URL to your image in a template with ``{{ the absolute URL to your image in a template with ``{{
@ -230,6 +230,14 @@ For example, say your ``MEDIA_ROOT`` is set to ``'/home/media'``, and
upload a file on Jan. 15, 2007, it will be saved in the directory upload a file on Jan. 15, 2007, it will be saved in the directory
``/home/media/photos/2007/01/15``. ``/home/media/photos/2007/01/15``.
Note that whenever you deal with uploaded files, you should pay close attention
to where you're uploading them and what type of files they are, to avoid
security holes. *Validate all uploaded files* so that you're sure the files are
what you think they are. For example, if you blindly let somebody upload files,
without validation, to a directory that's within your Web server's document
root, then somebody could upload a CGI or PHP script and execute that script by
visiting its URL on your site. Don't allow that.
.. _`strftime formatting`: http://docs.python.org/lib/module-time.html#l2h-1941 .. _`strftime formatting`: http://docs.python.org/lib/module-time.html#l2h-1941
``FilePathField`` ``FilePathField``
@ -678,8 +686,9 @@ you can use the name of the model, rather than the model object itself::
class Manufacturer(models.Model): class Manufacturer(models.Model):
# ... # ...
Note, however, that support for strings around model names in ``ForeignKey`` is Note, however, that you can only use strings to refer to models in the same
quite new, and it can be buggy in some cases. models.py file -- you cannot use a string to reference a model in a different
application, or to reference a model that has been imported from elsewhere.
Behind the scenes, Django appends ``"_id"`` to the field name to create its Behind the scenes, Django appends ``"_id"`` to the field name to create its
database column name. In the above example, the database table for the ``Car`` database column name. In the above example, the database table for the ``Car``
@ -801,7 +810,10 @@ here's how you'd represent that::
As with ``ForeignKey``, a relationship to self can be defined by using the As with ``ForeignKey``, a relationship to self can be defined by using the
string ``'self'`` instead of the model name, and you can refer to as-yet string ``'self'`` instead of the model name, and you can refer to as-yet
undefined models by using a string containing the model name. undefined models by using a string containing the model name. However, you
can only use strings to refer to models in the same models.py file -- you
cannot use a string to reference a model in a different application, or to
reference a model that has been imported from elsewhere.
It's suggested, but not required, that the name of a ``ManyToManyField`` It's suggested, but not required, that the name of a ``ManyToManyField``
(``toppings`` in the example above) be a plural describing the set of related (``toppings`` in the example above) be a plural describing the set of related
@ -1374,6 +1386,41 @@ user searches for ``john lennon``, Django will do the equivalent of this SQL
WHERE (first_name ILIKE '%john%' OR last_name ILIKE '%john%') WHERE (first_name ILIKE '%john%' OR last_name ILIKE '%john%')
AND (first_name ILIKE '%lennon%' OR last_name ILIKE '%lennon%') AND (first_name ILIKE '%lennon%' OR last_name ILIKE '%lennon%')
**New in Django development version:** For faster and/or more restrictive
searches, prefix the field name with an operator:
``^``
Matches the beginning of the field. For example, if ``search_fields`` is
set to ``['^first_name', '^last_name']`` and a user searches for
``john lennon``, Django will do the equivalent of this SQL ``WHERE``
clause::
WHERE (first_name ILIKE 'john%' OR last_name ILIKE 'john%')
AND (first_name ILIKE 'lennon%' OR last_name ILIKE 'lennon%')
This query is more efficient than the normal ``'%john%'`` query, because
the database only needs to check the beginning of a column's data, rather
than seeking through the entire column's data. Plus, if the column has an
index on it, some databases may be able to use the index for this query,
even though it's a ``LIKE`` query.
``=``
Matches exactly, case-insensitive. For example, if
``search_fields`` is set to ``['=first_name', '=last_name']`` and
a user searches for ``john lennon``, Django will do the equivalent
of this SQL ``WHERE`` clause::
WHERE (first_name ILIKE 'john' OR last_name ILIKE 'john')
AND (first_name ILIKE 'lennon' OR last_name ILIKE 'lennon')
Note that the query input is split by spaces, so, following this example,
it's not currently not possible to search for all records in which
``first_name`` is exactly ``'john winston'`` (containing a space).
``@``
Performs a full-text match. This is like the default search method but uses
an index. Currently this is only available for MySQL.
Managers Managers
======== ========

View File

@ -259,9 +259,10 @@ an `HttpRequest object`_ as its first argument. For example::
The second difference is that it automatically populates the context with a few The second difference is that it automatically populates the context with a few
variables, according to your `TEMPLATE_CONTEXT_PROCESSORS setting`_. variables, according to your `TEMPLATE_CONTEXT_PROCESSORS setting`_.
The ``TEMPLATE_CONTEXT_PROCESSORS`` setting is a tuple of callables that take a The ``TEMPLATE_CONTEXT_PROCESSORS`` setting is a tuple of callables -- called
request object as their argument and return a dictionary of items to be merged **context processors** -- that take a request object as their argument and
into the context. By default, ``TEMPLATE_CONTEXT_PROCESSORS`` is set to:: return a dictionary of items to be merged into the context. By default,
``TEMPLATE_CONTEXT_PROCESSORS`` is set to::
("django.core.context_processors.auth", ("django.core.context_processors.auth",
"django.core.context_processors.debug", "django.core.context_processors.debug",