diff --git a/AUTHORS b/AUTHORS
index fb00ca43fe..e52fb46b47 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -68,6 +68,7 @@ answer newbie questions, and generally made Django that much better:
deric@monowerks.com
dne@mayonnaise.net
Jeremy Dunck
+ Andy Dustman
Clint Ecker
gandalf@owca.info
Baishampayan Ghose
diff --git a/django/bin/compile-messages.py b/django/bin/compile-messages.py
index 44a84de379..07dcce7bf6 100755
--- a/django/bin/compile-messages.py
+++ b/django/bin/compile-messages.py
@@ -11,7 +11,7 @@ def compile_messages():
elif os.path.isdir('locale'):
basedir = os.path.abspath('locale')
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)
for dirpath, dirnames, filenames in os.walk(basedir):
@@ -19,7 +19,14 @@ def compile_messages():
if f.endswith('.po'):
sys.stderr.write('processing file %s in %s\n' % (f, dirpath))
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)
if __name__ == "__main__":
diff --git a/django/conf/locale/ru/LC_MESSAGES/django.mo b/django/conf/locale/ru/LC_MESSAGES/django.mo
index d45691bd30..467c8ddb62 100644
Binary files a/django/conf/locale/ru/LC_MESSAGES/django.mo and b/django/conf/locale/ru/LC_MESSAGES/django.mo differ
diff --git a/django/conf/locale/ru/LC_MESSAGES/django.po b/django/conf/locale/ru/LC_MESSAGES/django.po
index 4e5ff239f8..ca204d2ddf 100644
--- a/django/conf/locale/ru/LC_MESSAGES/django.po
+++ b/django/conf/locale/ru/LC_MESSAGES/django.po
@@ -5,17 +5,21 @@
#
msgid ""
msgstr ""
-"Project-Id-Version: django\n"
+"Project-Id-Version: django 0.95\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2006-05-16 10:11+0200\n"
-"PO-Revision-Date: 2005-11-26 00:00\n"
-"Last-Translator: Dmitry Sorokin \n"
-"Language-Team: LANGUAGE \n"
+"PO-Revision-Date: 2006-08-14 18:08+0300\n"
+"Last-Translator: Grigory Fateyev \n"
+"Language-Team: Dialcom Services \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\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"
msgstr "ID объекта"
@@ -23,7 +27,8 @@ msgstr "ID объекта"
msgid "headline"
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
msgid "comment"
msgstr "комментарий"
@@ -64,15 +69,18 @@ msgstr "рейтинг #8"
msgid "is valid rating"
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"
msgstr "дата/время добавления"
-#: contrib/comments/models.py:84 contrib/comments/models.py:170
+#: contrib/comments/models.py:84
+#: contrib/comments/models.py:170
msgid "is public"
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"
msgstr "IP адрес"
@@ -81,19 +89,15 @@ msgid "is removed"
msgstr "удален"
#: contrib/comments/models.py:86
-msgid ""
-"Check this box if the comment is inappropriate. A \"This comment has been "
-"removed\" message will be displayed instead."
-msgstr ""
-"Отметте, если комментарий нежелателен. Сообщение \"Этот комментарий был "
-"удалён\" будет показано взамен."
+msgid "Check this box if the comment is inappropriate. A \"This comment has been removed\" message will be displayed instead."
+msgstr "Отметте, если комментарий нежелателен. Сообщение \"Этот комментарий был удалён\" будет показано взамен."
#: contrib/comments/models.py:91
-#, fuzzy
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"
msgstr "Объект наполнения"
@@ -141,7 +145,6 @@ msgid "score date"
msgstr "счёт времени"
#: contrib/comments/models.py:237
-#, fuzzy
msgid "karma score"
msgstr "Карма счёт"
@@ -152,7 +155,7 @@ msgstr "Карма счета"
#: contrib/comments/models.py:242
#, python-format
msgid "%(score)d rating by %(user)s"
-msgstr ""
+msgstr "%(score)d рейтинг %(user)s"
#: contrib/comments/models.py:258
#, python-format
@@ -197,7 +200,7 @@ msgstr "Удаления модератором"
#: contrib/comments/models.py:285
#, python-format
msgid "Moderator deletion by %r"
-msgstr ""
+msgstr "Удаления модератора %r"
#: contrib/comments/views/karma.py:19
msgid "Anonymous users cannot vote"
@@ -212,20 +215,17 @@ msgid "No voting for yourself"
msgstr "Нельзя голосовать за себя"
#: contrib/comments/views/comments.py:28
-msgid ""
-"This rating is required because you've entered at least one other rating."
-msgstr ""
+msgid "This rating is required because you've entered at least one other rating."
+msgstr "Этот рейтинг необходим, так как вы входили хоть однажды в другие рейтинги."
#: contrib/comments/views/comments.py:112
#, python-format
msgid ""
-"This comment was posted by a user who has posted fewer than %(count)s "
-"comment:\n"
+"This comment was posted by a user who has posted fewer than %(count)s comment:\n"
"\n"
"%(text)s"
msgid_plural ""
-"This comment was posted by a user who has posted fewer than %(count)s "
-"comments:\n"
+"This comment was posted by a user who has posted fewer than %(count)s comments:\n"
"\n"
"%(text)s"
msgstr[0] ""
@@ -259,11 +259,8 @@ msgstr "Кто-то вмешивается в форму комментария
#: contrib/comments/views/comments.py:207
#: contrib/comments/views/comments.py:292
-msgid ""
-"The comment form had an invalid 'target' parameter -- the object ID was "
-"invalid"
-msgstr ""
-"Форма комментария имеет неверный 'target' параметр -- ID объекта неверно"
+msgid "The comment form had an invalid 'target' parameter -- the object ID was invalid"
+msgstr "Форма комментария имеет неверный 'target' параметр -- ID объекта неверно"
#: contrib/comments/views/comments.py:257
#: contrib/comments/views/comments.py:321
@@ -344,8 +341,11 @@ msgid ""
"
By %s:
\n"
"
\n"
msgstr ""
+"
К %s:
\n"
+"
\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
msgid "All"
msgstr "Все"
@@ -414,14 +414,11 @@ msgstr "журнальные записи"
msgid "All dates"
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
-msgid ""
-"Please enter a correct username and password. Note that both fields are case-"
-"sensitive."
-msgstr ""
-"Пожалуйста, вводите верные данные именя пользователя и пароль. Помните, оба "
-"поля чувствительны к регистру."
+msgid "Please enter a correct username and password. Note that both fields are case-sensitive."
+msgstr "Пожалуйста, вводите верные данные именя пользователя и пароль. Помните, оба поля чувствительны к регистру."
#: contrib/admin/views/decorators.py:23
#: contrib/admin/templates/admin/login.html:25
@@ -429,20 +426,12 @@ msgid "Log in"
msgstr "Вход"
#: contrib/admin/views/decorators.py:61
-msgid ""
-"Please log in again, because your session has expired. Don't worry: Your "
-"submission has been saved."
-msgstr ""
-"Пожалуйста войдите снова, посколькук ваша сессия устарела. Не беспокойтесь:"
-"введенные вами данные сохранены."
+msgid "Please log in again, because your session has expired. Don't worry: Your submission has been saved."
+msgstr "Пожалуйста войдите снова, посколькук ваша сессия устарела. Не беспокойтесь:введенные вами данные сохранены."
#: contrib/admin/views/decorators.py:68
-msgid ""
-"Looks like your browser isn't configured to accept cookies. Please enable "
-"cookies, reload this page, and try again."
-msgstr ""
-"Похоже, что ваш броузер не настроен на прием cookies. Пожалуйства включите "
-"cookie, перезагрузите страницу и попытайтесь снова. "
+msgid "Looks like your browser isn't configured to accept cookies. Please enable cookies, reload this page, and try again."
+msgstr "Похоже, что ваш броузер не настроен на прием cookies. Пожалуйства включите cookie, перезагрузите страницу и попытайтесь снова. "
#: contrib/admin/views/decorators.py:82
msgid "Usernames cannot contain the '@' character."
@@ -451,7 +440,7 @@ msgstr "Имя пользователя не может включать сим
#: contrib/admin/views/decorators.py:84
#, python-format
msgid "Your e-mail address is not your username. Try '%s' instead."
-msgstr ""
+msgstr "Ваш e-mail адрес не ваше имя. Попробуйте '%s' в замен."
#: contrib/admin/views/main.py:226
msgid "Site administration"
@@ -462,11 +451,13 @@ msgstr "Администрирование сайта"
msgid "The %(name)s \"%(obj)s\" was added successfully."
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."
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
msgid "You may add another %s below."
msgstr "Вы можете добавить %s внизу."
@@ -481,7 +472,8 @@ msgstr "Добавить %s"
msgid "Added %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
msgid "and"
msgstr "и"
@@ -498,18 +490,17 @@ msgstr "Удалено %s."
#: contrib/admin/views/main.py:343
msgid "No fields changed."
-msgstr ""
+msgstr "Ни одно поле не изменено."
#: contrib/admin/views/main.py:346
#, python-format
msgid "The %(name)s \"%(obj)s\" was changed successfully."
-msgstr ""
+msgstr "%(name)s \"%(obj)s\" было успешно изменено"
#: contrib/admin/views/main.py:354
#, python-format
-msgid ""
-"The %(name)s \"%(obj)s\" was added successfully. You may edit it again below."
-msgstr ""
+msgid "The %(name)s \"%(obj)s\" was added successfully. You may edit it again below."
+msgstr "%(name)s \"%(obj)s\" было успешно изменено. Вы можете редактировать его снова."
#: contrib/admin/views/main.py:392
#, python-format
@@ -550,9 +541,12 @@ msgstr "Выберите %s"
msgid "Select %s to change"
msgstr "Выберите %s для изменения"
-#: contrib/admin/views/doc.py:277 contrib/admin/views/doc.py:286
-#: contrib/admin/views/doc.py:288 contrib/admin/views/doc.py:294
-#: contrib/admin/views/doc.py:295 contrib/admin/views/doc.py:297
+#: contrib/admin/views/doc.py:277
+#: contrib/admin/views/doc.py:286
+#: 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"
msgstr "Целое"
@@ -560,7 +554,8 @@ msgstr "Целое"
msgid "Boolean (Either True or 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
msgid "String (up to %(maxlength)s)"
msgstr "Строка (до %(maxlength)s символов)"
@@ -581,7 +576,8 @@ msgstr "Дата (с указанием времени)"
msgid "E-mail address"
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"
msgstr "Путь к файлу"
@@ -595,7 +591,7 @@ msgstr "Логическое (True, False или None)"
#: contrib/admin/views/doc.py:292
msgid "Relation to parent model"
-msgstr ""
+msgstr "Зависимость на родительскую модель."
#: contrib/admin/views/doc.py:293
msgid "Phone number"
@@ -609,7 +605,8 @@ msgstr "Текст"
msgid "Time"
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"
msgstr "URL"
@@ -689,12 +686,8 @@ msgid "DATE_WITH_TIME_FULL"
msgstr "j. N Y, H:i"
#: contrib/admin/templates/admin/object_history.html:36
-msgid ""
-"This object doesn't have a change history. It probably wasn't added via this "
-"admin site."
-msgstr ""
-"Данный обьект не имеет истории изменения. Возможно он не был добавлен через "
-"данный административный сайт."
+msgid "This object doesn't have a change history. It probably wasn't added via this admin site."
+msgstr "Данный обьект не имеет истории изменения. Возможно он не был добавлен через данный административный сайт."
#: contrib/admin/templates/admin/base_site.html:4
msgid "Django site admin"
@@ -717,12 +710,8 @@ msgid "Server Error (500)"
msgstr "Ошибка сервера (500)"
#: contrib/admin/templates/admin/500.html:10
-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."
-msgstr ""
-"Произошла ошибка. Отчет об ошибке отправлен администраторам сайта по e-mailи "
-"она должна быть вскоре исправлена. Благодарим вас на терпение и помощь."
+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."
+msgstr "Произошла ошибка. Отчет об ошибке отправлен администраторам сайта по e-mailи она должна быть вскоре исправлена. Благодарим вас на терпение и помощь."
#: contrib/admin/templates/admin/404.html:4
#: contrib/admin/templates/admin/404.html:8
@@ -736,7 +725,7 @@ msgstr "К сожалению, запрашиваемая вами страни
#: contrib/admin/templates/admin/index.html:17
#, python-format
msgid "Models available in the %(name)s application."
-msgstr "Модели доступны в %(name) приложении."
+msgstr "Модели доступны в %(name)s приложении."
#: contrib/admin/templates/admin/index.html:28
#: contrib/admin/templates/admin/change_form.html:15
@@ -783,23 +772,13 @@ msgstr "Удалить"
#: contrib/admin/templates/admin/delete_confirmation.html:14
#, python-format
-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:"
-msgstr ""
-"Удаление объекта %(object_name)s '%(object)s' приведет к удалению зависимых "
-"элементов, но предоставленных вам прав недостаточно для удаления следующих "
-"типов объектов:"
+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:"
+msgstr "Удаление объекта %(object_name)s '%(object)s' приведет к удалению зависимых элементов, но предоставленных вам прав недостаточно для удаления следующих типов объектов:"
#: contrib/admin/templates/admin/delete_confirmation.html:21
#, python-format
-msgid ""
-"Are you sure you want to delete the %(object_name)s \"%(object)s\"? All of "
-"the following related items will be deleted:"
-msgstr ""
-"Вы уверены, что хотите удалить %(object_name)s \"%(object)s\"? Все "
-"следующие объекты также будут удалены:"
+msgid "Are you sure you want to delete the %(object_name)s \"%(object)s\"? All of the following related items will be deleted:"
+msgstr "Вы уверены, что хотите удалить %(object_name)s \"%(object)s\"? Все следующие объекты также будут удалены:"
#: contrib/admin/templates/admin/delete_confirmation.html:26
msgid "Yes, I'm sure"
@@ -808,7 +787,7 @@ msgstr "Да, я уверен"
#: contrib/admin/templates/admin/filter.html:2
#, python-format
msgid " By %(title)s "
-msgstr ""
+msgstr "К%(title)s "
#: contrib/admin/templates/admin/search_form.html:8
msgid "Go"
@@ -872,12 +851,8 @@ msgid "Password reset"
msgstr "Сброс пароля"
#: contrib/admin/templates/registration/password_reset_form.html:12
-msgid ""
-"Forgotten your password? Enter your e-mail address below, and we'll reset "
-"your password and e-mail the new one to you."
-msgstr ""
-"Забыли пароль? Введите ваш e-mail адрес ниже и мы очистим ваш старый пароль, "
-"и вышлем вам по e-mail новый."
+msgid "Forgotten your password? Enter your e-mail address below, and we'll reset your password and e-mail the new one to you."
+msgstr "Забыли пароль? Введите ваш e-mail адрес ниже и мы очистим ваш старый пароль, и вышлем вам по e-mail новый."
#: contrib/admin/templates/registration/password_reset_form.html:16
msgid "E-mail address:"
@@ -901,20 +876,12 @@ msgid "Password reset successful"
msgstr "Успешная очистка пароля"
#: contrib/admin/templates/registration/password_reset_done.html:12
-msgid ""
-"We've e-mailed a new password to the e-mail address you submitted. You "
-"should be receiving it shortly."
-msgstr ""
-"Мы отправили новый пароль по указанному вами адресу электронной почты. Вы "
-"должны его вскоре получить."
+msgid "We've e-mailed a new password to the e-mail address you submitted. You should be receiving it shortly."
+msgstr "Мы отправили новый пароль по указанному вами адресу электронной почты. Вы должны его вскоре получить."
#: contrib/admin/templates/registration/password_change_form.html:12
-msgid ""
-"Please enter your old password, for security's sake, and then enter your new "
-"password twice so we can verify you typed it in correctly."
-msgstr ""
-"В целях безопасности, пожалуйста, введите ваш старый пароль, затем - новый "
-"пароль дважды, с тем, чтобы мы могли убедиться в правильности написания."
+msgid "Please enter your old password, for security's sake, and then enter your new password twice so we can verify you typed it in correctly."
+msgstr "В целях безопасности, пожалуйста, введите ваш старый пароль, затем - новый пароль дважды, с тем, чтобы мы могли убедиться в правильности написания."
#: contrib/admin/templates/registration/password_change_form.html:17
msgid "Old password:"
@@ -987,24 +954,16 @@ msgid "Documentation for this page"
msgstr "Документация по данной странице"
#: contrib/admin/templates/admin_doc/bookmarklets.html:20
-msgid ""
-"Jumps you from any page to the documentation for the view that generates "
-"that page."
-msgstr ""
-"Перенаправит вас с любой страницы к просмотру документа, который генерирует "
-"эту страницу."
+msgid "Jumps you from any page to the documentation for the view that generates that page."
+msgstr "Перенаправит вас с любой страницы к просмотру документа, который генерирует эту страницу."
#: contrib/admin/templates/admin_doc/bookmarklets.html:22
msgid "Show object ID"
msgstr "Показать ID обьекта"
#: contrib/admin/templates/admin_doc/bookmarklets.html:23
-msgid ""
-"Shows the content-type and unique ID for pages that represent a single "
-"object."
-msgstr ""
-"Показывает тип наполнения и уникальный ID для страниц, которые означают "
-"одинокий объект."
+msgid "Shows the content-type and unique ID for pages that represent a single object."
+msgstr "Показывает тип наполнения и уникальный ID для страниц, которые означают одинокий объект."
#: contrib/admin/templates/admin_doc/bookmarklets.html:25
msgid "Edit this object (current window)"
@@ -1043,24 +1002,16 @@ msgid "redirect from"
msgstr "перенаправить из"
#: contrib/redirects/models.py:8
-msgid ""
-"This should be an absolute path, excluding the domain name. Example: '/"
-"events/search/'."
-msgstr ""
-"Это должен быть абсолютный путь, исключая доменное имя. Пример: '/events/"
-"search/'."
+msgid "This should be an absolute path, excluding the domain name. Example: '/events/search/'."
+msgstr "Это должен быть абсолютный путь, исключая доменное имя. Пример: '/events/search/'."
#: contrib/redirects/models.py:9
msgid "redirect to"
msgstr "перенаправить на"
#: contrib/redirects/models.py:10
-msgid ""
-"This can be either an absolute path (as above) or a full URL starting with "
-"'http://'."
-msgstr ""
-"Это должен быть, либо абсолютный путь (как выше) или полный URL начинающийся "
-"с 'http://'."
+msgid "This can be either an absolute path (as above) or a full URL starting with 'http://'."
+msgstr "Это должен быть, либо абсолютный путь (как выше) или полный URL начинающийся с 'http://'."
#: contrib/redirects/models.py:12
msgid "redirect"
@@ -1071,10 +1022,8 @@ msgid "redirects"
msgstr "перенаправления"
#: contrib/flatpages/models.py:8
-msgid ""
-"Example: '/about/contact/'. Make sure to have leading and trailing slashes."
-msgstr ""
-"Пример: '/about/contact/'. Будьте уверенны, что вставили завепршающий слэш."
+msgid "Example: '/about/contact/'. Make sure to have leading and trailing slashes."
+msgstr "Пример: '/about/contact/'. Будьте уверенны, что вставили завепршающий слэш."
#: contrib/flatpages/models.py:9
msgid "title"
@@ -1093,10 +1042,8 @@ msgid "template name"
msgstr "имя шаблона"
#: contrib/flatpages/models.py:13
-msgid ""
-"Example: 'flatpages/contact_page'. If this isn't provided, the system will "
-"use 'flatpages/default'."
-msgstr ""
+msgid "Example: 'flatpages/contact_page'. If this isn't provided, the system will use 'flatpages/default'."
+msgstr "Пример: 'flatpages/contact_page'. Если этот файл не присутствует, система будет использовать 'flatpages/default'."
#: contrib/flatpages/models.py:14
msgid "registration required"
@@ -1114,7 +1061,8 @@ msgstr "простая страница"
msgid "flat pages"
msgstr "простые страницы"
-#: contrib/auth/models.py:13 contrib/auth/models.py:26
+#: contrib/auth/models.py:13
+#: contrib/auth/models.py:26
msgid "name"
msgstr "имя"
@@ -1126,7 +1074,8 @@ msgstr "код"
msgid "permission"
msgstr "Права"
-#: contrib/auth/models.py:18 contrib/auth/models.py:27
+#: contrib/auth/models.py:18
+#: contrib/auth/models.py:27
msgid "permissions"
msgstr "Права"
@@ -1134,7 +1083,8 @@ msgstr "Права"
msgid "group"
msgstr "Группа"
-#: contrib/auth/models.py:30 contrib/auth/models.py:65
+#: contrib/auth/models.py:30
+#: contrib/auth/models.py:65
msgid "groups"
msgstr "Группы"
@@ -1160,7 +1110,7 @@ msgstr "пароль"
#: contrib/auth/models.py:59
msgid "Use '[algo]$[salt]$[hexdigest]'"
-msgstr ""
+msgstr "Используйте '[algo]$[salt]$[hexdigest]'"
#: contrib/auth/models.py:60
msgid "staff status"
@@ -1187,12 +1137,8 @@ msgid "date joined"
msgstr "дата регистрации"
#: contrib/auth/models.py:66
-msgid ""
-"In addition to the permissions manually assigned, this user will also get "
-"all permissions granted to each group he/she is in."
-msgstr ""
-"К добавлению к перавам выбрнанным вуручную, этот пользователь может получить "
-"все права группы, к которой он принадлежит."
+msgid "In addition to the permissions manually assigned, this user will also get all permissions granted to each group he/she is in."
+msgstr "К добавлению к перавам выбрнанным вуручную, этот пользователь может получить все права группы, к которой он принадлежит."
#: contrib/auth/models.py:67
msgid "user permissions"
@@ -1227,10 +1173,8 @@ msgid "message"
msgstr "Сообщение"
#: contrib/auth/forms.py:30
-msgid ""
-"Your Web browser doesn't appear to have cookies enabled. Cookies are "
-"required for logging in."
-msgstr ""
+msgid "Your Web browser doesn't appear to have cookies enabled. Cookies are required for logging in."
+msgstr "У вашего браузера не включены cookies. Cookies необходимы для входа."
#: contrib/contenttypes/models.py:25
msgid "python model class name"
@@ -1328,23 +1272,28 @@ msgstr "Январь"
msgid "February"
msgstr "Февраль"
-#: utils/dates.py:14 utils/dates.py:27
+#: utils/dates.py:14
+#: utils/dates.py:27
msgid "March"
msgstr "Март"
-#: utils/dates.py:14 utils/dates.py:27
+#: utils/dates.py:14
+#: utils/dates.py:27
msgid "April"
msgstr "Апрель"
-#: utils/dates.py:14 utils/dates.py:27
+#: utils/dates.py:14
+#: utils/dates.py:27
msgid "May"
msgstr "Май"
-#: utils/dates.py:14 utils/dates.py:27
+#: utils/dates.py:14
+#: utils/dates.py:27
msgid "June"
msgstr "Июнь"
-#: utils/dates.py:15 utils/dates.py:27
+#: utils/dates.py:15
+#: utils/dates.py:27
msgid "July"
msgstr "Июль"
@@ -1593,11 +1542,8 @@ msgid "This value must contain only letters, numbers and underscores."
msgstr "Значение может содержать только буквы, цифры и подчеркивания."
#: core/validators.py:64
-msgid ""
-"This value must contain only letters, numbers, underscores, dashes or "
-"slashes."
-msgstr "Значение может содержать только буквы, цифры, подчеркивания, дифисы или "
-"тере."
+msgid "This value must contain only letters, numbers, underscores, dashes or slashes."
+msgstr "Значение может содержать только буквы, цифры, подчеркивания, дифисы или тере."
#: core/validators.py:72
msgid "Uppercase letters are not allowed here."
@@ -1647,7 +1593,8 @@ msgstr "Вводите реальную дату в формате YYYY-MM-DD."
msgid "Enter a valid time in HH:MM format."
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."
msgstr "Вводите реальные дата/время в формате YYYY-MM-DD HH:MM."
@@ -1656,12 +1603,8 @@ msgid "Enter a valid e-mail address."
msgstr "Укажите реальный e-mail адрес."
#: core/validators.py:148
-msgid ""
-"Upload a valid image. The file you uploaded was either not an image or a "
-"corrupted image."
-msgstr ""
-"Загрузите реальное изображение. Файл, который вы загружали, не был "
-"изображением или был поврежден."
+msgid "Upload a valid image. The file you uploaded was either not an image or a corrupted image."
+msgstr "Загрузите реальное изображение. Файл, который вы загружали, не был изображением или был поврежден."
#: core/validators.py:155
#, python-format
@@ -1701,7 +1644,8 @@ msgstr "Неверный формат XML: %s"
msgid "Invalid URL: %s"
msgstr "Неверный URL: %s"
-#: core/validators.py:206 core/validators.py:208
+#: core/validators.py:206
+#: core/validators.py:208
#, python-format
msgid "The URL %s is a broken link."
msgstr "URL %s сломанная ссылка."
@@ -1726,7 +1670,8 @@ msgstr "Это поле должно совпадать с полем '%s'."
msgid "Please enter something for at least one field."
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."
msgstr "Пожалуйста, заполните оба поля либо оставьте их пустыми."
@@ -1756,26 +1701,16 @@ msgstr "Пожалуйста, вводите корректное десятич
#: core/validators.py:349
#, python-format
msgid "Please enter a valid decimal number with at most %s total digit."
-msgid_plural ""
-"Please enter a valid decimal number with at most %s total digits."
-msgstr[0] ""
-"Пожалуйста, вводите корректное десятичное число с максимальным количеством "
-"знаков %s."
-msgstr[1] ""
-"Пожалуйста, вводите корректное десятичное число с максимальным количеством "
-"знаков %s."
+msgid_plural "Please enter a valid decimal number with at most %s total digits."
+msgstr[0] "Пожалуйста, вводите корректное десятичное число с максимальным количеством знаков %s."
+msgstr[1] "Пожалуйста, вводите корректное десятичное число с максимальным количеством знаков %s."
#: core/validators.py:352
#, python-format
msgid "Please enter a valid decimal number with at most %s decimal place."
-msgid_plural ""
-"Please enter a valid decimal number with at most %s decimal places."
-msgstr[0] ""
-"Пожалуйста, вводите корректное десятичное число с максимальным количеством "
-"знаков после запятой %s."
-msgstr[1] ""
-"Пожалуйста, вводите корректное десятичное число с максимальным количеством "
-"знаков после запятой %s."
+msgid_plural "Please enter a valid decimal number with at most %s decimal places."
+msgstr[0] "Пожалуйста, вводите корректное десятичное число с максимальным количеством знаков после запятой %s."
+msgstr[1] "Пожалуйста, вводите корректное десятичное число с максимальным количеством знаков после запятой %s."
#: core/validators.py:362
#, python-format
@@ -1802,50 +1737,37 @@ msgstr "Невозможно получить что-либо с %s."
#: core/validators.py:429
#, python-format
-msgid ""
-"The URL %(url)s returned the invalid Content-Type header '%(contenttype)s'."
-msgstr "URL %(url) вернул неверный заголовок Content-Type '%(contenttype)'."
+msgid "The URL %(url)s returned the invalid Content-Type header '%(contenttype)s'."
+msgstr "URL %(url)s вернул неверный заголовок Content-Type '%(contenttype)s'."
#: core/validators.py:462
#, python-format
-msgid ""
-"Please close the unclosed %(tag)s tag from line %(line)s. (Line starts with "
-"\"%(start)s\".)"
+msgid "Please close the unclosed %(tag)s tag from line %(line)s. (Line starts with \"%(start)s\".)"
msgstr ""
#: core/validators.py:466
#, python-format
-msgid ""
-"Some text starting on line %(line)s is not allowed in that context. (Line "
-"starts with \"%(start)s\".)"
+msgid "Some text starting on line %(line)s is not allowed in that context. (Line starts with \"%(start)s\".)"
msgstr ""
#: core/validators.py:471
#, python-format
-msgid ""
-"\"%(attr)s\" on line %(line)s is an invalid attribute. (Line starts with \"%"
-"(start)s\".)"
+msgid "\"%(attr)s\" on line %(line)s is an invalid attribute. (Line starts with \"%(start)s\".)"
msgstr ""
#: core/validators.py:476
#, python-format
-msgid ""
-"\"<%(tag)s>\" on line %(line)s is an invalid tag. (Line starts with \"%"
-"(start)s\".)"
+msgid "\"<%(tag)s>\" on line %(line)s is an invalid tag. (Line starts with \"%(start)s\".)"
msgstr ""
#: core/validators.py:480
#, python-format
-msgid ""
-"A tag on line %(line)s is missing one or more required attributes. (Line "
-"starts with \"%(start)s\".)"
+msgid "A tag on line %(line)s is missing one or more required attributes. (Line starts with \"%(start)s\".)"
msgstr ""
#: core/validators.py:485
#, python-format
-msgid ""
-"The \"%(attr)s\" attribute on line %(line)s has an invalid value. (Line "
-"starts with \"%(start)s\".)"
+msgid "The \"%(attr)s\" attribute on line %(line)s has an invalid value. (Line starts with \"%(start)s\".)"
msgstr ""
#: db/models/manipulators.py:302
@@ -1858,8 +1780,10 @@ msgstr ""
msgid "%(optname)s with this %(fieldname)s already exists."
msgstr ""
-#: db/models/fields/__init__.py:114 db/models/fields/__init__.py:265
-#: db/models/fields/__init__.py:542 db/models/fields/__init__.py:553
+#: db/models/fields/__init__.py:114
+#: db/models/fields/__init__.py:265
+#: db/models/fields/__init__.py:542
+#: db/models/fields/__init__.py:553
#: forms/__init__.py:346
msgid "This field is required."
msgstr "Обязательное поле."
@@ -1869,14 +1793,12 @@ msgid "This value must be an integer."
msgstr ""
#: db/models/fields/__init__.py:369
-#, fuzzy
msgid "This value must be either True or False."
-msgstr "Логическое (True или False)"
+msgstr "Значение должно либо True либо False."
#: db/models/fields/__init__.py:385
-#, fuzzy
msgid "This field cannot be null."
-msgstr "Это поле неверно."
+msgstr "Это поле не может быть нулевым."
#: db/models/fields/__init__.py:562
msgid "Enter a valid filename."
@@ -1888,23 +1810,17 @@ msgid "Please enter a valid %s."
msgstr ""
#: db/models/fields/related.py:579
-#, fuzzy
msgid "Separate multiple IDs with commas."
msgstr "Несколько значений ID разделяйте запятыми."
#: db/models/fields/related.py:581
-#, fuzzy
-msgid ""
-"Hold down \"Control\", or \"Command\" on a Mac, to select more than one."
-msgstr ""
-" Удерживайте \"Control\", или \"Command\" на Макинтош, для выбора больше чем "
-"одного."
+msgid "Hold down \"Control\", or \"Command\" on a Mac, to select more than one."
+msgstr " Удерживайте \"Control\", или \"Command\" на Макинтош, для выбора больше чем одного."
#: db/models/fields/related.py:625
#, python-format
msgid "Please enter valid %(self)s IDs. The value %(value)r is invalid."
-msgid_plural ""
-"Please enter valid %(self)s IDs. The values %(value)r are invalid."
+msgid_plural "Please enter valid %(self)s IDs. The values %(value)r are invalid."
msgstr[0] ""
msgstr[1] ""
@@ -1919,7 +1835,9 @@ msgstr[1] ""
msgid "Line breaks are not allowed here."
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
msgid "Select a valid choice; '%(data)s' is not in %(choices)s."
msgstr ""
@@ -1944,30 +1862,3 @@ msgstr "Введите целое число в диапазоне от 0 до 3
msgid "yes,no,maybe"
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 (500)"
-#~ msgstr "Ошибка сервера (500)"
diff --git a/django/conf/project_template/settings.py b/django/conf/project_template/settings.py
index 63e07c061a..d6f34a28db 100644
--- a/django/conf/project_template/settings.py
+++ b/django/conf/project_template/settings.py
@@ -27,6 +27,10 @@ LANGUAGE_CODE = 'en-us'
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.
# Example: "/home/media/media.lawrence.com/"
MEDIA_ROOT = ''
diff --git a/django/contrib/admin/templates/admin/base.html b/django/contrib/admin/templates/admin/base.html
index 41514e6a81..b63604b268 100644
--- a/django/contrib/admin/templates/admin/base.html
+++ b/django/contrib/admin/templates/admin/base.html
@@ -6,6 +6,7 @@
{% if LANGUAGE_BIDI %}{% endif %}
{% block extrastyle %}{% endblock %}
{% block extrahead %}{% endblock %}
+{% block blockbots %}{% endblock %}
{% load i18n %}
diff --git a/django/contrib/admin/views/doc.py b/django/contrib/admin/views/doc.py
index d1541abee9..b724cc5485 100644
--- a/django/contrib/admin/views/doc.py
+++ b/django/contrib/admin/views/doc.py
@@ -226,7 +226,7 @@ def model_detail(request, app_label, model_name):
return render_to_response('admin_doc/model_detail.html', {
'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__,
'fields': fields,
}, context_instance=RequestContext(request))
diff --git a/django/contrib/admin/views/main.py b/django/contrib/admin/views/main.py
index 0f6167fc8f..7c942ca5b8 100644
--- a/django/contrib/admin/views/main.py
+++ b/django/contrib/admin/views/main.py
@@ -263,7 +263,9 @@ def add_stage(request, app_label, model_name, show_delete=False, form_url='', po
post_url_continue += "?_popup=1"
return HttpResponseRedirect(post_url_continue % pk_value)
if request.POST.has_key("_popup"):
- return HttpResponse('' % \
+ 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('' % \
(pk_value, str(new_object).replace('"', '\\"')))
elif request.POST.has_key("_addanother"):
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)
# 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:
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 = other_qs.filter(reduce(operator.or_, or_queries))
qs = qs & other_qs
diff --git a/django/core/cache/backends/memcached.py b/django/core/cache/backends/memcached.py
index 86ae096d2c..180f95da73 100644
--- a/django/core/cache/backends/memcached.py
+++ b/django/core/cache/backends/memcached.py
@@ -20,7 +20,7 @@ class CacheClass(BaseCache):
return val
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):
self._cache.delete(key)
diff --git a/django/middleware/cache.py b/django/middleware/cache.py
index 08e77d1375..58800b24da 100644
--- a/django/middleware/cache.py
+++ b/django/middleware/cache.py
@@ -41,6 +41,9 @@ class CacheMiddleware(object):
def process_request(self, request):
"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:
request._cache_update_cache = False
return None # Don't bother checking the cache.
diff --git a/django/middleware/http.py b/django/middleware/http.py
index 12d0c0f683..3ebd8ffd1a 100644
--- a/django/middleware/http.py
+++ b/django/middleware/http.py
@@ -35,3 +35,27 @@ class ConditionalGetMiddleware(object):
response.content = ''
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
diff --git a/docs/cache.txt b/docs/cache.txt
index 62fec289b9..1795345ed9 100644
--- a/docs/cache.txt
+++ b/docs/cache.txt
@@ -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
``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
-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
``HttpResponse``:
diff --git a/docs/faq.txt b/docs/faq.txt
index 3cd7090583..42d9ddea55 100644
--- a/docs/faq.txt
+++ b/docs/faq.txt
@@ -98,11 +98,10 @@ Lawrence, Kansas, USA.
On IRC, Simon goes by ``SimonW``.
`Wilson Miner`_
- Wilson's design-fu makes us all look like rock stars. When not sneaking
- into apartment complex swimming pools, he's the Commercial Development
- Director for World Online, which means he makes the money that pays all our
- paychecks. He lives in Lawrence, Kansas.
-
+ Wilson's design-fu makes us all look like rock stars. By day, he's an
+ interactive designer for `Apple`. Don't ask him what he's working on, or
+ he'll have to kill you. He lives in San Francisco.
+
On IRC, Wilson goes by ``wilsonian``.
.. _`World Online`: http://code.djangoproject.com/wiki/WorldOnline
@@ -113,6 +112,7 @@ Lawrence, Kansas, USA.
.. _`simon.incutio.com`: http://simon.incutio.com/
.. _`Jacob Kaplan-Moss`: http://www.jacobian.org/
.. _`Wilson Miner`: http://www.wilsonminer.com/
+.. _`Apple`: http://www.apple.com/
Which sites use Django?
-----------------------
diff --git a/docs/i18n.txt b/docs/i18n.txt
index e12900c2f9..4d0d92b082 100644
--- a/docs/i18n.txt
+++ b/docs/i18n.txt
@@ -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_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
-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
diff --git a/docs/middleware.txt b/docs/middleware.txt
index bad00fd890..efc4d89569 100644
--- a/docs/middleware.txt
+++ b/docs/middleware.txt
@@ -63,7 +63,7 @@ Adds a few conveniences for perfectionists:
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
through unchanged.
-
+
If ``PREPEND_WWW`` is ``True``, URLs that lack a leading "www." will be
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
``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
----------------------------------------------------
diff --git a/docs/model-api.txt b/docs/model-api.txt
index 502ceaf7ff..0a3abe4e26 100644
--- a/docs/model-api.txt
+++ b/docs/model-api.txt
@@ -217,7 +217,7 @@ steps:
subdirectory of ``MEDIA_ROOT`` it should upload files.
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__url`` function provided by Django. For
example, if your ``ImageField`` is called ``mug_shot``, you can get
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
``/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
``FilePathField``
@@ -678,8 +686,9 @@ you can use the name of the model, rather than the model object itself::
class Manufacturer(models.Model):
# ...
-Note, however, that support for strings around model names in ``ForeignKey`` is
-quite new, and it can be buggy in some cases.
+Note, however, that 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.
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``
@@ -801,7 +810,10 @@ here's how you'd represent that::
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
-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``
(``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%')
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
========
diff --git a/docs/templates_python.txt b/docs/templates_python.txt
index 95ccfb3eab..62069ffd6a 100644
--- a/docs/templates_python.txt
+++ b/docs/templates_python.txt
@@ -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
variables, according to your `TEMPLATE_CONTEXT_PROCESSORS setting`_.
-The ``TEMPLATE_CONTEXT_PROCESSORS`` setting is a tuple of callables that take a
-request object as their argument and return a dictionary of items to be merged
-into the context. By default, ``TEMPLATE_CONTEXT_PROCESSORS`` is set to::
+The ``TEMPLATE_CONTEXT_PROCESSORS`` setting is a tuple of callables -- called
+**context processors** -- that take a request object as their argument and
+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.debug",