# SOME DESCRIPTIVE TITLE. # Copyright (C) Django Software Foundation and contributors # This file is distributed under the same license as the Django package. # # Translators: # Dogify <595572594@qq.com>, 2018 # bing zhou <1996944@qq.com>, 2018 # Blg Mengde , 2020 # FSSlc , 2020 # Kevin Sze , 2014 # Le Yang , 2019 # mrgaolei , 2019 # orange shy , 2021 # Sean Chen , 2020 # Shellbye bai , 2018 # Tylor Caesar , 2023 # Veoco , 2020-2021,2023-2024 # weizhi ao, 2024 # Wenqing Xue , 2019 # Xiang Yu , 2014 # Xin Qi , 2021 # yhliyr , 2018 # Imken Luo, 2022 # Zhibo Zhang <805960083@qq.com>, 2019 # 传飞 丁 , 2019 # 锟斤拷 , 2016 # 小黑, 2023 # 得鑫 李 , 2018 # Dogify <595572594@qq.com>, 2018 # 高乐喆 , 2024 # 龙虎义, 2022 msgid "" msgstr "" "Project-Id-Version: django-docs\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2024-05-07 15:06-0500\n" "PO-Revision-Date: 2013-04-02 20:02+0000\n" "Last-Translator: Veoco , 2020-2021,2023-2024\n" "Language-Team: Chinese (China) (http://app.transifex.com/django/django-docs/" "language/zh_CN/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: zh_CN\n" "Plural-Forms: nplurals=1; plural=0;\n" msgid "Django version 0.95 release notes" msgstr "Django 0.95 版本发布说明" msgid "Welcome to the Django 0.95 release." msgstr "欢迎来到 Django 0.95 版本" msgid "" "This represents a significant advance in Django development since the 0.91 " "release in January 2006. The details of every change in this release would " "be too extensive to list in full, but a summary is presented below." msgstr "" "这表明了一个从 2006 年 1 月发布 0.91 版本以来 Django 部署过程的一个显著的进" "步。将这次发版的每一个改动的细节都详细的罗列出来将会占用太多的版面,但是下面" "有一个简短的介绍总结。" msgid "Suitability and API stability" msgstr "适用性和 API 的稳定性" msgid "" "This release is intended to provide a stable reference point for developers " "wanting to work on production-level applications that use Django." msgstr "" "这个发行版的目的是为想要在生产级应用中使用 Django 的开发者提供一个稳定的参考" "点。" msgid "" "However, it's not the 1.0 release, and we'll be introducing further changes " "before 1.0. For a clear look at which areas of the framework will change " "(and which ones will *not* change) before 1.0, see the ``api-stability.txt`` " "file, which lives in the docs/ directory of the distribution." msgstr "" "然而,这并不是 1.0 版本,我们将在 1.0 之前引入更多变化。要想清楚地了解在 1.0 " "之前框架的哪些地方会发生变化(哪些地方不会发生变化),请看 ``api-stability." "txt`` 文件,它位于发行版的 docs/ 目录中。" msgid "" "You may have a need to use some of the features that are marked as \"subject " "to API change\" in that document, but that's OK with us as long as it's OK " "with you, and as long as you understand APIs may change in the future." msgstr "" "不可能需要使用一些在该文档中被标记为 “subject to API change” 的功能,但只要你" "觉得没问题,我们也没问题,只要你理解 API 将来可能会改变。" msgid "" "Fortunately, most of Django's core APIs won't be changing before version " "1.0. There likely won't be as big of a change between 0.95 and 1.0 versions " "as there was between 0.91 and 0.95." msgstr "" "幸运的是,在 1.0 版本之前,Django 的大部分核心 API 都不会发生变化。0.95 和 " "1.0版本之间可能不会像 0.91 和 0.95 之间有那么大的变化。" msgid "Changes and new features" msgstr "改变及新特性" msgid "" "The major changes in this release (for developers currently using the 0.91 " "release) are a result of merging the 'magic-removal' branch of development. " "This branch removed a number of constraints in the way Django code had to be " "written that were a consequence of decisions made in the early days of " "Django, prior to its open-source release. It's now possible to write more " "natural, Pythonic code that works as expected, and there's less \"black " "magic\" happening behind the scenes." msgstr "" "这个版本的主要变化(对于目前使用 0.91 版本的开发者来说)是合并了 'magic-" "removal' 开发分支的结果。这个分支删除了 Django 代码编写方式中的一些限制因素," "这些限制因素是 Django 在开源发布之前的早期决定的结果。现在,我们可以写出更自" "然、更符合预期的 Pythonic 代码,而且幕后发生的“黑魔法”也少了。" msgid "" "Aside from that, another main theme of this release is a dramatic increase " "in usability. We've made countless improvements in error messages, " "documentation, etc., to improve developers' quality of life." msgstr "" "除此之外,此版本的另一个主题是可用性的显着增加。 我们在错误消息、文档等方面做" "了无数改进,以提高开发人员的生活质量。" msgid "The new features and changes introduced in 0.95 include:" msgstr "在 0.95 版本中引入的新特性和变更包括:" msgid "" "Django now uses a more consistent and natural filtering interface for " "retrieving objects from the database." msgstr "Django 现在使用更一致和自然的过滤接口来从数据库中检索对象。" msgid "" "User-defined models, functions and constants now appear in the module " "namespace they were defined in. (Previously everything was magically " "transferred to the ``django.models.*`` namespace.)" msgstr "" "用户定义的模型、函数和常量现在出现在它们所定义的模块命名空间中。(以前所有的" "东西都被神奇地转移到 ``django.models.*`` 的命名空间。)" msgid "" "Some optional applications, such as the FlatPage, Sites and Redirects apps, " "have been decoupled and moved into ``django.contrib``. If you don't want to " "use these applications, you no longer have to install their database tables." msgstr "" "一些可选的应用程序,如简单页面、站点和重定向应用,已经解耦并移入 ``django." "contrib``。 如果您不想使用这些应用程序,则不必再安装其数据库表中。" msgid "Django now has support for managing database transactions." msgstr "Django 现在支持管理数据库事务" msgid "" "We've added the ability to write custom authentication and authorization " "backends for authenticating users against alternate systems, such as LDAP." msgstr "" "我们添加了编写自定义身份验证和授权后端的功能,以便针对备用系统(如 LDAP)对用" "户进行身份验证。" msgid "" "We've made it easier to add custom table-level functions to models, through " "a new \"Manager\" API." msgstr "通过新的 “Manager” API,我们可以更轻松地将自定义表级功能添加到模型中。" msgid "" "It's now possible to use Django without a database. This simply means that " "the framework no longer requires you to have a working database set up just " "to serve dynamic pages. In other words, you can just use URLconfs/views on " "their own. Previously, the framework required that a database be configured, " "regardless of whether you actually used it." msgstr "" "现在可以在没有数据库的情况下使用 Django 了。这意味着框架不再需要你有一个工作" "的数据库来提供动态页面。换句话说,你可以只使用 URLconfs/views 本身。以前,该" "框架要求配置数据库,而不管你是否真的使用它。" msgid "" "It's now more explicit and natural to override ``save()`` and ``delete()`` " "methods on models, rather than needing to hook into the ``pre_save()`` and " "``post_save()`` method hooks." msgstr "" "现在,在模型上覆盖 save() 和 delete() 方法更加明确和自然,而不需要挂载 " "pre_save() 和 post_save() 方法的钩子。" msgid "" "Individual pieces of the framework now can be configured without requiring " "the setting of an environment variable. This permits use of, for example, " "the Django templating system inside other applications." msgstr "" "现在,框架的各个部分可以在不需要设置环境变量的情况下进行配置。这允许在其他应" "用程序中使用 Django 模板系统。" msgid "" "More and more parts of the framework have been internationalized, as we've " "expanded internationalization (i18n) support. The Django codebase, including " "code and templates, has now been translated, at least in part, into 31 " "languages. From Arabic to Chinese to Hungarian to Welsh, it is now possible " "to use Django's admin site in your native language." msgstr "" "随着我们扩展国际化(i18n)支持,该框架的越来越多部分已经实现了国际化。 " "Django 代码库(包括代码和模板)现已完成翻译,至少支持部分语言,多达 31种。支" "持了阿拉伯语,中文,匈牙利语,以及威尔士语,现在以母语使用 Django 的管理站" "点。" msgid "" "The number of changes required to port from 0.91-compatible code to the 0.95 " "code base are significant in some cases. However, they are, for the most " "part, reasonably routine and only need to be done once. A list of the " "necessary changes is described in the `Removing The Magic`_ wiki page. There " "is also an easy checklist_ for reference when undertaking the porting " "operation." msgstr "" "在某些情况下,从 0.91 兼容代码移植到 0.95 代码库所需的改动数量很大。然而,在" "大多数情况下,这些改动都是合理的常规改动,只需要做一次。在 `Removing The " "Magic`_ wiki 页面中描述了一个必要的更改列表。还有一个简单的 checklist_ ,供进" "行移植操作时参考。" msgid "Problem reports and getting help" msgstr "报告问题以及获取帮助" msgid "" "Need help resolving a problem with Django? The documentation in the " "distribution is also available :doc:`online ` at the `Django " "website`_. The :doc:`FAQ ` document is especially recommended, " "as it contains a number of issues that come up time and again." msgstr "" "需要帮助来解决 Django 相关的问题吗?在发行包中的文档也可以在 `Django 官网`_ " "中的 :doc:`在线文档` 处找到。其中 :doc:`FAQ ` 文档尤为推" "荐,因为它包含那些针对时不时会出现问题的解决方法。" msgid "" "For more personalized help, the `django-users`_ mailing list is a very " "active list, with more than 2,000 subscribers who can help you solve any " "sort of Django problem. We recommend you search the archives first, though, " "because many common questions appear with some regularity, and any " "particular problem may already have been answered." msgstr "" "对于更个性化的帮助,`django-users`_ 邮件列表是一个活跃的邮件列表,它有超过 " "2000 个订阅者,他们可以帮助你解决 Django 的各类问题。我们推荐你首先搜索查看以" "前的存档,因为很多通用问题经常出现多次,而那些特定问题可能也已经被回答了。" msgid "" "Finally, for those who prefer the more immediate feedback offered by IRC, " "there's a ``#django`` channel on ``irc.libera.chat`` that is regularly " "populated by Django users and developers from around the world. Friendly " "people are usually available at any hour of the day -- to help, or just to " "chat." msgstr "" "最后,对于那些愿意更快通过IRC提供反馈的人们,在 ``irc.libera.chat`` 上有一个 " "``#django`` 频道,是由Django用户和全世界开发者们发起的。友善的人们常常在一天" "中可用的任何时间里去帮助频道里的人,或者就是聊一聊天。" msgid "Thanks for using Django!" msgstr "感谢使用 Django!" msgid "The Django Team July 2006" msgstr "Django 项目始于 2006 年 7 月" msgid "Django version 0.96 release notes" msgstr "Django 0.96 版本发行说明" msgid "Welcome to Django 0.96!" msgstr "欢迎来到 Django 0.96 版本!" msgid "" "The primary goal for 0.96 is a cleanup and stabilization of the features " "introduced in 0.95. There have been a few small `backwards-incompatible " "changes`_ since 0.95, but the upgrade process should be fairly simple and " "should not require major changes to existing applications." msgstr "" "Django 0.96 版本的主要目标是清理和稳定由 0.95 版本引入的特性。自从 0.95 过" "后,有很多小的 `向后兼容变化`_,但升级过程应该足够简单,且针对已有的应用不应" "该需要重大的更改。" msgid "" "However, we're also releasing 0.96 now because we have a set of backwards-" "incompatible changes scheduled for the near future. Once completed, they " "will involve some code changes for application developers, so we recommend " "that you stick with Django 0.96 until the next official release; then you'll " "be able to upgrade in one step instead of needing to make incremental " "changes to keep up with the development version of Django." msgstr "" "不过,我们现在发布 0.96 版本也是因为我们计划在不久的将来进行一系列向后不兼容" "的改动。一旦完成,它们将涉及到应用程序开发人员的一些代码变化,所以我们建议你" "坚持使用 Django 0.96,直到下一个正式发布;然后你就可以一步到位地升级,而不是" "需要做增量的变化来跟上 Django 的开发版本。" msgid "Backwards-incompatible changes" msgstr "不向后兼容的变更" msgid "" "The following changes may require you to update your code when you switch " "from 0.95 to 0.96:" msgstr "当你从 0.95 切换到 0.96 时,以下更改可能需要你更新代码:" msgid "``MySQLdb`` version requirement" msgstr "``MySQLdb`` 版本需求" msgid "" "Due to a bug in older versions of the ``MySQLdb`` Python module (which " "Django uses to connect to MySQL databases), Django's MySQL backend now " "requires version 1.2.1p2 or higher of ``MySQLdb``, and will raise exceptions " "if you attempt to use an older version." msgstr "" "由于 ``MySQLdb`` Python 模块(Django 用来连接 MySQL 数据库)旧版本的一个漏" "洞,Django 的 MySQL 后端现在需要 1.2.1p2 或更高版本的 ``MySQLdb``,如果你试图" "使用旧版本,会引发异常。" msgid "" "If you're currently unable to upgrade your copy of ``MySQLdb`` to meet this " "requirement, a separate, backwards-compatible backend, called \"mysql_old\", " "has been added to Django. To use this backend, change the " "``DATABASE_ENGINE`` setting in your Django settings file from this::" msgstr "" "如果你目前无法升级你的 ``MySQLdb`` 来满足这个要求,一个单独的,向后兼容的后" "端,叫做 “mysql_old”,已经被添加到 Django 中。要使用这个后端,将 Django 配置" "文件中的 ``DATABASE_ENGINE`` 配置从这个:" msgid "to this::" msgstr "改成这个:" msgid "" "However, we strongly encourage MySQL users to upgrade to a more recent " "version of ``MySQLdb`` as soon as possible, The \"mysql_old\" backend is " "provided only to ease this transition, and is considered deprecated; aside " "from any necessary security fixes, it will not be actively maintained, and " "it will be removed in a future release of Django." msgstr "" "然而,我们强烈建议 MySQL 用户尽快升级到最新版本的 ``MySQLdb``,提供 " "“mysql_old” 后端只是为了方便过渡,并且被认为是废弃的;除了任何必要的安全修" "复,它将不会被积极维护,并将在未来的 Django 版本中删除。" msgid "" "Also, note that some features, like the new ``DATABASE_OPTIONS`` setting " "(see the :doc:`databases documentation ` for details), are " "only available on the \"mysql\" backend, and will not be made available for " "\"mysql_old\"." msgstr "" "另外,需要注意的是,有些功能,比如新的 ``DATABASE_OPTIONS`` 配置(详见 :doc:`" "数据库文档 ` ),只在 “mysql” 后端可用,不会对 “mysql_old” 提" "供。" msgid "Database constraint names changed" msgstr "数据库约束名称已更改" msgid "" "The format of the constraint names Django generates for foreign key " "references have changed slightly. These names are generally only used when " "it is not possible to put the reference directly on the affected column, so " "they are not always visible." msgstr "" "Django 为外键引用生成的约束名称的格式略有改变。这些名称一般只在无法将引用直接" "放在受影响的列上时才会使用,所以它们并不总是可见的。" msgid "" "The effect of this change is that running ``manage.py reset`` and similar " "commands against an existing database may generate SQL with the new form of " "constraint name, while the database itself contains constraints named in the " "old form; this will cause the database server to raise an error message " "about modifying nonexistent constraints." msgstr "" "这一变化的影响是,对现有数据库运行 ``manage.py reset`` 和类似的命令,可能会生" "成新形式的约束名称的 SQL,而数据库本身却包含旧形式的约束;这将导致数据库服务" "器发出关于修改不存在的约束的错误信息。" msgid "If you need to work around this, there are two methods available:" msgstr "若你需要解决此问题,那将有两种方法可用:" msgid "" "Redirect the output of ``manage.py`` to a file, and edit the generated SQL " "to use the correct constraint names before executing it." msgstr "" "将 ``manage.py`` 的输出重定向到一个文件中,并编辑生成的 SQL,在执行前使用正确" "的约束名。" msgid "" "Examine the output of ``manage.py sqlall`` to see the new-style constraint " "names, and use that as a guide to rename existing constraints in your " "database." msgstr "" "检查 ``manage.py sqlall`` 的输出,看看新样式的约束名称,并以此为指导重命名数" "据库中的现有约束。" msgid "Name changes in ``manage.py``" msgstr "``manage.py`` 中的名称改变" msgid "" "A few of the options to ``manage.py`` have changed with the addition of " "fixture support:" msgstr "``manage.py`` 的一些选项在增加了固定数据支持后有所改变。" msgid "" "There are new ``dumpdata`` and ``loaddata`` commands which, as you might " "expect, will dump and load data to/from the database. These commands can " "operate against any of Django's supported serialization formats." msgstr "" "有新的 ``dumpdata`` 和 ``loaddata`` 命令,正如你所期望的那样,这些命令将用来" "从数据库中导出和导入数据。这些命令可以对任何 Django 支持的序列化格式进行操" "作。" msgid "" "The ``sqlinitialdata`` command has been renamed to ``sqlcustom`` to " "emphasize that ``loaddata`` should be used for data (and ``sqlcustom`` for " "other custom SQL -- views, stored procedures, etc.)." msgstr "" "``sqlinitialdata`` 命令已改名为 ``sqlcustom``,以强调 ``loaddata`` 应用于数据" "(``sqlcustom`` 用于其他自定义 SQL ——视图、存储过程等)。" msgid "The vestigial ``install`` command has been removed. Use ``syncdb``." msgstr "``install`` 命令已被删除。使用 ``syncdb``。" msgid "Backslash escaping changed" msgstr "反斜杠转义的改变" msgid "" "The Django database API now escapes backslashes given as query parameters. " "If you have any database API code that matches backslashes, and it was " "working before (despite the lack of escaping), you'll have to change your " "code to \"unescape\" the slashes one level." msgstr "" "Django 数据库 API 现在可以转义作为查询参数的反斜线。如果你有任何匹配反斜线的" "数据库 API 代码,并且之前还能正常工作(尽管没有转义),你必须修改你的代码,将" "斜线“取消转义”一个级别。" msgid "For example, this used to work::" msgstr "例如,下面的查询在以前可以生效:" msgid "The above is now incorrect, and should be rewritten as::" msgstr "但在现在上面的命令不再正确了,并且应该重写为下面这样:" msgid "Removed ENABLE_PSYCO setting" msgstr "被移除的 ENABLE_PSYCO 配置" msgid "" "The ``ENABLE_PSYCO`` setting no longer exists. If your settings file " "includes ``ENABLE_PSYCO`` it will have no effect; to use Psyco_, we " "recommend writing a middleware class to activate it." msgstr "" "``ENABLE_PSYCO`` 设定将不再存在。假如你的设定文件包括 ``ENABLE_PSYCO`` ,那么" "它将不再生效。为了使用 Psyco_,我们建议写一个中间件类来激活它。" msgid "What's new in 0.96?" msgstr "0.96 新特性" msgid "" "This revision represents over a thousand source commits and over four " "hundred bug fixes, so we can't possibly catalog all the changes. Here, we " "describe the most notable changes in this release." msgstr "" "本次版本号的更改代表有超过 1000 次代码提交和超过 400 次漏洞修复,所以我们不能" "详细罗列所有的变化。在这里我们将描述本次发布中最为重要的变化。" msgid "New forms library" msgstr "新的表单库" msgid "" "``django.newforms`` is Django's new form-handling library. It's a " "replacement for ``django.forms``, the old form/manipulator/validation " "framework. Both APIs are available in 0.96, but over the next two releases " "we plan to switch completely to the new forms system, and deprecate and " "remove the old system." msgstr "" "``django.newforms`` 是 Django 新的表单处理库。它是 ``django.forms`` 这个旧的" "表单/操作器/验证框架的一个替代。这两个 API 在 0.96 版本中都可用,但在接下来" "的两个版本发布中,我们计划完全切换到新的表单系统,并标记失效和移除旧的系统。" msgid "There are three elements to this transition:" msgstr "针对这个的过渡将分三步:" msgid "" "We've copied the current ``django.forms`` to ``django.oldforms``. This " "allows you to upgrade your code *now* rather than waiting for the backwards-" "incompatible change and rushing to fix your code after the fact. Just " "change your import statements like this::" msgstr "" "我们已经将当前的 ``django.forms`` 复制到了 ``django.oldforms``。这将允许你 *" "现在* 升级你的代码而不是等待向后不兼容的改变,然后匆忙修复你的代码。只需要像" "下面这样更改你的 import 声明:" msgid "" "The next official release of Django will move the current ``django." "newforms`` to ``django.forms``. This will be a backwards-incompatible " "change, and anyone still using the old version of ``django.forms`` at that " "time will need to change their import statements as described above." msgstr "" "Django 的下一个正式版本将把当前的 ``django.newforms`` 移到 ``django.forms``。" "这将是一个向后不兼容的变化,届时还在使用旧版 ``django.forms`` 的人将需要如上" "所述修改他们的导入语句。" msgid "The next release after that will completely remove ``django.oldforms``." msgstr "在那之后的下一个发布版本将完全移除 ``django.oldforms``。" msgid "" "Although the ``newforms`` library will continue to evolve, it's ready for " "use for most common cases. We recommend that anyone new to form handling " "skip the old forms system and start with the new." msgstr "" "尽管 ``newforms`` 将会继续演进,但它足以应付大多数场景。我们建议任何新接触表" "单处理的人员跳过旧的表单系统而直接使用新的表单系统。" msgid "" "For more information about ``django.newforms``, read the :doc:`newforms " "documentation `." msgstr "" "想了解更多关于 ``django.newforms`` 的信息,请阅读 :doc:`新表单 `。" msgid "URLconf improvements" msgstr "URLconf 的改进" msgid "" "You can now use any callable as the callback in URLconfs (previously, only " "strings that referred to callables were allowed). This allows a much more " "natural use of URLconfs. For example, this URLconf::" msgstr "" "现在,你可以在 URLconfs 中使用任何可调用对象作为回调内容(以前,只允许使用引" "用可调用对象的字符串)。这使得 URLconfs 的使用更加自然。例如,这个 URLconf:" msgid "can now be rewritten as::" msgstr "可以被重写为:" msgid "" "One useful application of this can be seen when using decorators; this " "change allows you to apply decorators to views *in your URLconf*. Thus, you " "can make a generic view require login very easily::" msgstr "" "一个有用的应用程序可以在使用装饰器时看到;这个变化允许你将装饰器应用到 *你的 " "URLconf* 中的视图。因此,你可以很容易地使一个通用的视图需要登录:" msgid "" "Note that both syntaxes (strings and callables) are valid, and will continue " "to be valid for the foreseeable future." msgstr "" "请注意,这两种语法(字符串和可调用对象)都是有效的,并且在可预见的未来将继续" "有效。" msgid "The test framework" msgstr "测试框架" msgid "" "Django now includes a test framework so you can start transmuting fear into " "boredom (with apologies to Kent Beck). You can write tests based on :mod:" "`doctest` or :mod:`unittest` and test your views with a simple test client." msgstr "" "Django 现在包含了一个测试框架,所以你可以开始将恐惧转化为无聊(向 Kent Beck " "道歉)。你可以基于 :mod:`doctest` 或 :mod:`unittest` 来编写测试,并用一个简单" "的测试客户端来测试你的视图。" msgid "" "There is also new support for \"fixtures\" -- initial data, stored in any of " "the supported :doc:`serialization formats `, that " "will be loaded into your database at the start of your tests. This makes " "testing with real data much easier." msgstr "" "还有对 “固定数据” 的新支持——初始数据,存储在任何支持的 :doc:`序列化格式 ` 中,将在测试开始时加载到你的数据库中。这使得使用真实数" "据进行测试变得更加容易。" msgid "" "See :doc:`the testing documentation ` for the full " "details." msgstr "详见 :doc:`测试文档 `。" msgid "Improvements to the admin interface" msgstr "管理界面的改进" msgid "" "A small change, but a very nice one: dedicated views for adding and updating " "users have been added to the admin interface, so you no longer need to worry " "about working with hashed passwords in the admin." msgstr "" "一个很小但是很不错的修改:在管理界面中增加了用于添加和更新用户的专用视图,所" "以你不再需要担心在管理中使用哈希密码的问题。" msgid "Thanks" msgstr "谢谢" msgid "" "Since 0.95, a number of people have stepped forward and taken a major new " "role in Django's development. We'd like to thank these people for all their " "hard work:" msgstr "" "从版本 0.95 起,有许多人站了出来并在 Django 的项目发展中扮演了主要角色。我们" "想要向这些人的辛勤工作表达我们的谢意。" msgid "" "Russell Keith-Magee and Malcolm Tredinnick for their major code " "contributions. This release wouldn't have been possible without them." msgstr "" "Russell Keith-Magee 和 Malcolm Tredinnick 对代码的主要贡献。没有他们,这个版" "本是不可能的。" msgid "" "Our new release manager, James Bennett, for his work in getting out 0.95.1, " "0.96, and (hopefully) future release." msgstr "" "我们的新发行版管理者 James Bennett,感谢他在发布 0.95.1、0.96 和(希望)未来" "版本方面所做的工作。" msgid "" "Our ticket managers Chris Beaven (aka SmileyChris), Simon Greenhill, Michael " "Radziej, and Gary Wilson. They agreed to take on the monumental task of " "wrangling our tickets into nicely cataloged submission. Figuring out what to " "work on is now about a million times easier; thanks again, guys." msgstr "" "我们的工单管理者 Chris Beaven(又名 SmileyChris)、Simon Greenhill、Michael " "Radziej 和 Gary Wilson。他们同意承担起将我们的工单整理成目录提交的艰巨任务。" "找出要做什么现在是一百万倍的容易;再次感谢,伙计们。" msgid "" "Everyone who submitted a bug report, patch or ticket comment. We can't " "possibly thank everyone by name -- over 200 developers submitted patches " "that went into 0.96 -- but everyone who's contributed to Django is listed " "in :source:`AUTHORS`." msgstr "" "所有提交错误报告、补丁或工单评论的人。我们不可能对每个人的名字表示感谢——超过 " "200 个开发者提交了 0.96 版本的补丁——但每个为 Django 做出贡献的人都在 :source:" "`AUTHORS` 中列出。" msgid "Django 1.0 release notes" msgstr "Django 1.0 版本发行说明" msgid "Welcome to Django 1.0!" msgstr "欢迎来到 Django 1.0 版本!" msgid "" "We've been looking forward to this moment for over three years, and it's " "finally here. Django 1.0 represents the largest milestone in Django's " "development to date: a web framework that a group of perfectionists can " "truly be proud of." msgstr "" "我们期待这一刻已经三年多了,现在它终于来了。Django 1.0是Django开发过程中最大" "的一个里程碑:这是一个让一群完美主义者感到自豪的Web框架。" msgid "" "Django 1.0 represents over three years of community development as an Open " "Source project. Django's received contributions from hundreds of developers, " "been translated into fifty languages, and today is used by developers on " "every continent and in every kind of job." msgstr "" "Django 1.0 作为一个开发了三年多的开源项目,得到了数百名开发人员的支持,并被翻" "译成50多种语言,现在仍广泛的被世界各地的开发人员用于各种工作中" msgid "" "An interesting historical note: when Django was first released in July 2005, " "the initial released version of Django came from an internal repository at " "revision number 8825. Django 1.0 represents revision 8961 of our public " "repository. It seems fitting that our 1.0 release comes at the moment where " "community contributions overtake those made privately." msgstr "" "一个有趣的历史性注意事项:当Django于2005年7月第一次发布的时候,最初发布的" "Django版本来自互联网仓库,修订版本号是8825。Django 1.0 代表的是我们公开仓库里" "的修订版 8961。这看起来是符合我们当时1.0发布的到来,那个时候社区贡献者们都过" "度地私有化。" msgid "Stability and forwards-compatibility" msgstr "稳定性和向前兼容性" msgid "" "The release of Django 1.0 comes with a promise of API stability and forwards-" "compatibility. In a nutshell, this means that code you develop against " "Django 1.0 will continue to work against 1.1 unchanged, and you should need " "to make only minor changes for any 1.X release." msgstr "" "随着Django 1.0的发布,提供了承诺的API稳定性和向前兼容性。意思就是你针对" "Django 1.0所开发的代码能够用在1.1版本没有变化的地方,然后只需要你做少量的代码" "变更就可以适用 1.X 版本。" msgid "" "See the :doc:`API stability guide ` for full details." msgstr "查阅 :doc:`API 稳定性指南 ` 了解详细信息" msgid "" "Django 1.0 has a number of backwards-incompatible changes from Django 0.96. " "If you have apps written against Django 0.96 that you need to port, see our " "detailed porting guide:" msgstr "" "Django 1.0 有许多与 Django 0.96 不兼容的修改。如果您有Django 0.96 的应用需要" "移植,请查看我们的详细移植指南。" msgid "" "A complete list of backwards-incompatible changes can be found at https://" "code.djangoproject.com/wiki/BackwardsIncompatibleChanges." msgstr "" "查看不兼容的更改列表请移步:https://code.djangoproject.com/wiki/" "BackwardsIncompatibleChanges." msgid "What's new in Django 1.0" msgstr "Django 1.0 新特性" msgid "A *lot*!" msgstr "很多" msgid "" "Since Django 0.96, we've made over 4,000 code commits, fixed more than 2,000 " "bugs, and edited, added, or removed around 350,000 lines of code. We've also " "added 40,000 lines of new documentation, and greatly improved what was " "already there." msgstr "" "从 Django 0.96 开始,我们已经提交了 4000 多次的代码,修复了 2000 多个漏洞,并" "编辑了大约 350000 行的代码。我们还添加了 40000 行的新文档,极大的改进了现有的" "内容。" msgid "" "In fact, new documentation is one of our favorite features of Django 1.0, so " "we might as well start there. First, there's a new documentation site:" msgstr "" "事实上,新的文档就是Django 1.0中我们喜欢的特性之一,所以我们也会从新的文档作" "为起点。首先,新的文档网页是:" msgid "https://docs.djangoproject.com/" msgstr "https://docs.djangoproject.com/" msgid "" "The documentation has been greatly improved, cleaned up, and generally made " "awesome. There's now dedicated search, indexes, and more." msgstr "" "文档已经有了很大的提升,整洁,而且通常做的很好。目前专注在搜索、索引,以及等" "等功能上。" msgid "" "We can't possibly document everything that's new in 1.0, but the " "documentation will be your definitive guide. Anywhere you see something like:" msgstr "" "在新的1.0版本中我们无法对每一件事做到文档化,但文档确实能作为你的开发指南。任" "何你所看到的,例如:" msgid "This feature is new in Django 1.0" msgstr "此功能是 Django 1.0 中的新功能" msgid "You'll know that you're looking at something new or changed." msgstr "你能知道你所要找的新内容,或者有哪些变化。" msgid "The other major highlights of Django 1.0 are:" msgstr "Django 1.0其它的主要亮点有:" msgid "Refactored admin application" msgstr "重构的管理应用程序" msgid "" "The Django administrative interface (``django.contrib.admin``) has been " "completely refactored; admin definitions are now completely decoupled from " "model definitions (no more ``class Admin`` declaration in models!), " "rewritten to use Django's new form-handling library (introduced in the 0.96 " "release as ``django.newforms``, and now available as simply ``django." "forms``) and redesigned with extensibility and customization in mind. Full " "documentation for the admin application is available online in the official " "Django documentation:" msgstr "" "Django的管理接口 (``django.contrib.admin``) 已经完全重构了;管理员定义功能目" "前完全解构成模块定义形式 (不再是 ``class Admin`` 模块中的类形式!) ,重写代码" "来使用Django的新表单处理库 (曾在 0.96 版本中介绍成 ``django.newforms`` 内容," "而此时直接可用成 ``django.forms`` 了) 以及重新设计成具有扩展能力和自定义能" "力。完整的管理员应用程序文档在官方Django文档网站上可以看到:" msgid "See the :doc:`admin reference ` for details" msgstr "参考 :doc:`管理员指南 ` 了解细节" msgid "Improved Unicode handling" msgstr "改进了 Unicode 的处理" msgid "" "Django's internals have been refactored to use Unicode throughout; this " "drastically simplifies the task of dealing with non-Western-European content " "and data in Django. Additionally, utility functions have been provided to " "ease interoperability with third-party libraries and systems which may or " "may not handle Unicode gracefully. Details are available in Django's Unicode-" "handling documentation." msgstr "" "Django内部机制已经重构成使用Unicode字符集;这回彻底让在Django中使用处理非西欧" "内容和数据的任务变得容易。另外,工具函数都提供成容易与第三方库协同工作的函" "数,甚至也能够与那些不能处理Unicode字符集的操作系统一起协同工作。细节都可以在" "Django的Unicode处理文档中找到可用的内容。" msgid "See :doc:`/ref/unicode`." msgstr "参见 :doc:`/ref/unicode`。" msgid "An improved ORM" msgstr "一项ORM提升" msgid "" "Django's object-relational mapper -- the component which provides the " "mapping between Django model classes and your database, and which mediates " "your database queries -- has been dramatically improved by a massive " "refactoring. For most users of Django this is backwards-compatible; the " "public-facing API for database querying underwent a few minor changes, but " "most of the updates took place in the ORM's internals. A guide to the " "changes, including backwards-incompatible modifications and mentions of new " "features opened up by this refactoring, is `available on the Django wiki`__." msgstr "" "Django 的面向对象关系映射器——提供 Django 模型类与您的数据库之间的映射,并调解" "你的数据库查询的组件——通过大规模重构得到了显著改进。对于大多数使用 Django 的" "用户来说,这保持了向后兼容性;公开的数据库查询 API 经历了一些细微的变化,但大" "部分更新都发生在 ORM 的内部结构中。关于这些变化的指南,包括不向后兼容的修改和" "由这次重构开启的新功能提及,`在 Django 维基上可以获取`__ 。" msgid "Automatic escaping of template variables" msgstr "模版变量的自动转义" msgid "" "To provide improved security against cross-site scripting (XSS) " "vulnerabilities, Django's template system now automatically escapes the " "output of variables. This behavior is configurable, and allows both " "variables and larger template constructs to be marked as safe (requiring no " "escaping) or unsafe (requiring escaping). A full guide to this feature is in " "the documentation for the :ttag:`autoescape` tag." msgstr "" "要提供针对跨网页脚本(XSS)漏洞的安全提升,Django的模版系统现在会对变量结果进" "行自动转义。这种行为是可以进行配置的,而且既可以允许变量标记出安全,也可以对" "更大模版的建立标记成安全(即需要不执行转义)或标记成不安全(即需要执行转" "义)。自动转移这个特性的完整指南在文档中 :ttag:`autoescape` 标签位置上。" msgid "``django.contrib.gis`` (GeoDjango)" msgstr "``django.contrib.gis`` (Django地理信息功能)" msgid "" "A project over a year in the making, this adds world-class GIS (`Geographic " "Information Systems`_) support to Django, in the form of a ``contrib`` " "application. Its documentation is currently being maintained externally, and " "will be merged into the main Django documentation shortly. Huge thanks go to " "Justin Bronn, Jeremy Dunck, Brett Hoerner and Travis Pinney for their " "efforts in creating and completing this feature." msgstr "" "一个为期超过一年以上的项目,就是世界级别类型的GIS (`地理信息系统`_) 支持了" "Django框架,是以一种 ``contrib`` 应用程序形式运作的。本身的文档目前由项目外团" "队进行维护,并且很快以后会合并到Django主文档中去。非常感谢 Justin Bronn, " "Jeremy Dunck, Brett Hoerner 和 Travis Pinney 为建立和完成本特性而做出的努力。" msgid "See :doc:`GeoDjango ` for details." msgstr "详见 :doc:`GeoDjango `。" msgid "Pluggable file storage" msgstr "移动文件存储" msgid "" "Django's built-in ``FileField`` and ``ImageField`` now can take advantage of " "pluggable file-storage backends, allowing extensive customization of where " "and how uploaded files get stored by Django. For details, see :doc:`the " "files documentation `; big thanks go to Marty Alchin for " "putting in the hard work to get this completed." msgstr "" "Django的内置 ``FileField`` 和 ``ImageField`` 目前获得了后端移动文件存储的功能" "优势,Django允许扩展自定义上传文件,指定上传文件的位置和如何上传文件。细节可" "以查看 :doc:`文件文档内容 `; 非常感谢 Marty Alchin 投入了艰难" "的工作完成这项特性功能。" msgid "Jython compatibility" msgstr "Jython 兼容性" msgid "" "Thanks to a lot of work from Leo Soto during a Google Summer of Code " "project, Django's codebase has been refactored to remove incompatibilities " "with `Jython`_, an implementation of Python written in Java, which runs " "Python code on the Java Virtual Machine. Django is now compatible with the " "forthcoming Jython 2.5 release." msgstr "" "非常感谢 Leo Soto 在谷歌夏季编程项目中做了大量工作,Django 的代码库已经重构后" "删除了与 `Jython`_ 不兼容的代码部分,一个用 Java 写的 Python 实现,可以在 " "Java 虚拟机上运行 Python 代码。Django 目前可以兼容即将发布的 Jython 2.5 版本" "了。" msgid "Generic relations in forms and admin" msgstr "表单和管理员中的普通关联" msgid "" "Classes are now included in ``django.contrib.contenttypes`` which can be " "used to support generic relations in both the admin interface and in end-" "user forms. See :ref:`the documentation for generic relations ` for details." msgstr "" "许多类目前都放在了 ``django.contrib.contenttypes`` 模块中,这是用来支持后台接" "口和用户形式的普通关联。参考 :ref:`普通关联文档 ` 了解细" "节。" msgid "``INSERT``/``UPDATE`` distinction" msgstr "``INSERT``和``UPDATE`` 区别" msgid "" "Although Django's default behavior of having a model's ``save()`` method " "automatically determine whether to perform an ``INSERT`` or an ``UPDATE`` at " "the SQL level is suitable for the majority of cases, there are occasional " "situations where forcing one or the other is useful. As a result, models can " "now support an additional parameter to ``save()`` which can force a specific " "operation." msgstr "" "尽管 Django对于SQL数据库 ``INSERT``或 ``UPDATE`` 操作有一个默认自动执行的模型" "``save()``方法行为,在大多数情况下都适用,但偶尔也有一些情况要强制使用一个或" "另一个才行。作为结果,许多模块目前可以支持另一个可选参数,让``save()``方法强" "制执行具体的一个操作。" msgid "See :ref:`ref-models-force-insert` for details." msgstr "参考 :ref:`指向模型强制插入` 文档了解细节。" msgid "Split ``CacheMiddleware``" msgstr "去掉 ``CacheMiddleware``" msgid "" "Django's ``CacheMiddleware`` has been split into three classes: " "``CacheMiddleware`` itself still exists and retains all of its previous " "functionality, but it is now built from two separate middleware classes " "which handle the two parts of caching (inserting into and reading from the " "cache) separately, offering additional flexibility for situations where " "combining these functions into a single middleware posed problems." msgstr "" "Django的 ``CacheMiddleware`` 已经分解成三个类了: ``CacheMiddleware`` 依然存" "在并且保留了以前本身的全部功能,但目前建立要从2个不同的中间件类来建立,分别处" "理缓存中的2个部分 (插入到缓存中和从缓存中读取),这样为一些情况提供了额外的灵" "活性,例如把许多功能组合到一个中间件里来解决问题。" msgid "" "Full details, including updated notes on appropriate use, are in :doc:`the " "caching documentation `." msgstr "" "全部细节,包括适当地更新注释,都在 :doc:`缓存文档 ` 中。" msgid "Refactored ``django.contrib.comments``" msgstr "重构 ``django.contrib.comments``" msgid "" "As part of a Google Summer of Code project, Thejaswi Puthraya carried out a " "major rewrite and refactoring of Django's bundled comment system, greatly " "increasing its flexibility and customizability." msgstr "" "作为谷歌夏季代码项目的一部分, Thejaswi Puthraya 负责主要的重写和重构Django的" "捆绑注释系统,极大地提高了灵活性和自定义功能。" msgid "Removal of deprecated features" msgstr "移除淘汰的特性" msgid "" "A number of features and methods which had previously been marked as " "deprecated, and which were scheduled for removal prior to the 1.0 release, " "are no longer present in Django. These include imports of the form library " "from ``django.newforms`` (now located simply at ``django.forms``), the " "``form_for_model`` and ``form_for_instance`` helper functions (which have " "been replaced by ``ModelForm``) and a number of deprecated features which " "were replaced by the dispatcher, file-uploading and file-storage refactoring " "introduced in the Django 1.0 alpha releases." msgstr "" "一些特性和方法前面已经标记成淘汰的内容,而且在1.0版本发布时会被移除,在现在的" "Django版本中已经没有了。这些包括了导入库名 ``django.newforms`` (目前导入库名" "直接变成了 ``django.forms``),而且 ``form_for_model`` 和 " "``form_for_instance`` 辅助函数 (都被 ``ModelForm`` 所取代) 以及一些淘汰的特性" "都换成了调度器,文件上传和文件存储功能,在Django 1.0 alpha版本中进行的重构。" msgid "Known issues" msgstr "已知问题" msgid "" "We've done our best to make Django 1.0 as solid as possible, but " "unfortunately there are a couple of issues that we know about in the release." msgstr "" "我们让 Django 1.0 尽可能成为稳固版本做了最好的工作,但不幸的是在发布后依然有" "一些问题。" msgid "Multi-table model inheritance with ``to_field``" msgstr "多表模型继承使用 ``to_field`` " msgid "" "If you're using :ref:`multiple table model inheritance `, be aware of this caveat: child models using a custom " "``parent_link`` and ``to_field`` will cause database integrity errors. A set " "of models like the following are **not valid**::" msgstr "" "如果你正在使用 :ref:`多表模型继承 ` 的话,要知道一项" "警告:子模型在使用一个自定义 ``parent_link`` 和 ``to_field`` 的时候会导致数据" "库整合错误。一套模型可能会出现 **not valid**::" msgid "This bug will be fixed in the next release of Django." msgstr "这个漏洞将在 Django 的下一个版本中修复。" msgid "Caveats with support of certain databases" msgstr "警告中含带某些数据库支持信息" msgid "" "Django attempts to support as many features as possible on all database " "backends. However, not all database backends are alike, and in particular " "many of the supported database differ greatly from version to version. It's " "a good idea to checkout our :doc:`notes on supported database `:" msgstr "" "Django 尽可能支持所有数据库后端的特性。不管如何,不是所有的数据库后端都可能实" "现,并且在许多特殊的数据库支持上都是每个版本都有不同之处。有一个好的办法就是" "查阅文档 :doc:`所支持的数据库注意事项 `:" msgid ":ref:`mysql-notes`" msgstr ":ref:`mysql-notes`" msgid ":ref:`sqlite-notes`" msgstr ":ref:`sqlite-notes`" msgid ":ref:`oracle-notes`" msgstr ":ref:`oracle-notes`" msgid "Porting your apps from Django 0.96 to 1.0" msgstr "将你的应用从 Django 0.96 移植到 1.0" msgid "Django 1.0 breaks compatibility with 0.96 in some areas." msgstr "Django 1.0 在某些地方与 0.96 版本是不兼容的。" msgid "" "This guide will help you port 0.96 projects and apps to 1.0. The first part " "of this document includes the common changes needed to run with 1.0. If " "after going through the first part your code still breaks, check the section " "`Less-common Changes`_ for a list of a bunch of less-common compatibility " "issues." msgstr "" "这个指南会帮助你把 0.96 的项目和应用移植到 1.0 版本。本文档的第一部分包含了需" "要运行在 1.0上的常见变更。如果通过了第一部分的变更,你的代码依然无法运行,那" "么请检查 `Less-common Changes`_ 不常见的变更部分中列出的兼容问题。" msgid "" "The :doc:`1.0 release notes `. That document explains the new " "features in 1.0 more deeply; the porting guide is more concerned with " "helping you quickly update your code." msgstr "" "文档 :doc:`1.0 版本注意事项 `。这份文档更深入地解释了 1.0 中新" "的特性;移植指南更多考虑了帮助你快速更新你的代码。" msgid "Common changes" msgstr "常见变更" msgid "" "This section describes the changes between 0.96 and 1.0 that most users will " "need to make." msgstr "" "本部分描述了 0.96 与 1.0 之间的变更,这些变更都是大部分用户会做的事情。" msgid "Use Unicode" msgstr "使用 Unicode 字符集" msgid "" "Change string literals (``'foo'``) into Unicode literals (``u'foo'``). " "Django now uses Unicode strings throughout. In most places, raw strings will " "continue to work, but updating to use Unicode literals will prevent some " "obscure problems." msgstr "" "逐字地把字符串 (``'foo'``) 变成 Unicode 字符串 (``u'foo'``)。Django 目前从始" "至终贯穿地使用 Unicode 字符集字符串。在绝大多数地方,生食字符串会继续有效,但" "更新成 Unicode 字符串会防止某些含糊的问题出现。" msgid "See :doc:`/ref/unicode` for full details." msgstr "查阅 :doc:`/ref/unicode` 文档了解细节。" msgid "Models" msgstr "模型" msgid "Common changes to your models file:" msgstr "对于你的模型文件中常见的变更:" msgid "Rename ``maxlength`` to ``max_length``" msgstr "``maxlength`` 重命名为 ``max_length``" msgid "" "Rename your ``maxlength`` argument to ``max_length`` (this was changed to be " "consistent with form fields):" msgstr "" "把你的 ``maxlength`` 参数名变成 ``max_length`` (这次参数名的变更是为了与表单" "区域保持一致):" msgid "Replace ``__str__`` with ``__unicode__``" msgstr "用 ``__unicode__`` 代替 ``__str__``" msgid "" "Replace your model's ``__str__`` function with a ``__unicode__`` method, and " "make sure you `use Unicode`_ (``u'foo'``) in that method." msgstr "" "使用 ``__unicode__`` 方法替换你的模型中的 ``__str__`` 函数,然后才能确保你使" "用 `使用 Unicode 字符集`_ (``u'foo'``) 中所介绍的方法。" msgid "Remove ``prepopulated_from``" msgstr "移除 ``prepopulated_from``" msgid "" "Remove the ``prepopulated_from`` argument on model fields. It's no longer " "valid and has been moved to the ``ModelAdmin`` class in ``admin.py``. See " "`the admin`_, below, for more details about changes to the admin." msgstr "" "删除模型区域中 ``prepopulated_from`` 参数。这个参数不再合法,而且已经转移到管" "理员 ``admin.py`` 模块里的 ``ModelAdmin`` 类中去了。查阅 `管理员`_ 内容了解更" "多对管理员变更的细节。" msgid "Remove ``core``" msgstr "移除 ``core``" msgid "" "Remove the ``core`` argument from your model fields. It is no longer " "necessary, since the equivalent functionality (part of :ref:`inline editing " "`) is handled differently by the admin interface now. You " "don't have to worry about inline editing until you get to `the admin`_ " "section, below. For now, remove all references to ``core``." msgstr "" "删除你的模型区域里的 ``core`` 参数。这个参数不再需要了,因为相同功能 (参考 :" "ref:`行内编辑 `) 目前已经由后台接口做出不同地处理。你不用再担" "心行内编辑,除非你在 `管理员`_ 部分才考虑行内编辑。目前,删除所有对 ``core`` " "参数的指向。" msgid "Replace ``class Admin:`` with ``admin.py``" msgstr "用 ``admin.py`` 替换 ``class Admin:``" msgid "" "Remove all your inner ``class Admin`` declarations from your models. They " "won't break anything if you leave them, but they also won't do anything. To " "register apps with the admin you'll move those declarations to an ``admin." "py`` file; see `the admin`_ below for more details." msgstr "" "从你的模型里移除所有嵌入 ``class Admin`` 管理员类声明。如果你保留这种类的话," "不会对任何有影响,但也不会起任何作用。要注册应用程序管理员,你要把这种类的声" "明移到 ``admin.py`` 管理员模块文件里;查看 `管理员`_ 内容了解更多细节。" msgid "" "A contributor to djangosnippets__ has written a script that'll `scan your " "models.py and generate a corresponding admin.py`__." msgstr "" "对 djangosnippets__ 做出的贡献者已经写了一个脚本会 `扫描你的 models.py 模型模" "块后生成一个相应的 admin.py 管理员模块`__。" msgid "Example" msgstr "例如" msgid "" "Below is an example ``models.py`` file with all the changes you'll need to " "make:" msgstr "下面的一个例子 ``models.py`` 模型文件含有所有你需要做出的变更:" msgid "Old (0.96) ``models.py``::" msgstr "老版本 (0.96) ``models.py``::" msgid "New (1.0) ``models.py``::" msgstr "新版本 (1.0) ``models.py``::" msgid "New (1.0) ``admin.py``::" msgstr "新版本 (1.0) ``admin.py`` 管理员模块:" msgid "The Admin" msgstr "管理员" msgid "" "One of the biggest changes in 1.0 is the new admin. The Django " "administrative interface (``django.contrib.admin``) has been completely " "refactored; admin definitions are now completely decoupled from model " "definitions, the framework has been rewritten to use Django's new form-" "handling library and redesigned with extensibility and customization in mind." msgstr "" "在 1.0 版本中最具挑战性的新管理员功能问题之一。Django 管理接口 (``django." "contrib.admin``) 管理员功能已经完全重构了;许多管理员定义目前都完全从许多模型" "定义中解构出来,许多框架都重写后使用 Django 的新表单处理库,而且重新设计成具" "有扩展和自定义能力。" msgid "" "Practically, this means you'll need to rewrite all of your ``class Admin`` " "declarations. You've already seen in `models`_ above how to replace your " "``class Admin`` with an ``admin.site.register()`` call in an ``admin.py`` " "file. Below are some more details on how to rewrite that ``Admin`` " "declaration into the new syntax." msgstr "" "实际中,意味着你要重写所有你的 ``class Admin`` 管理员类声明。你已经在上面的 " "`models`_ 中见过了如何替换你的 ``class Admin`` 管理员类,就是在 ``admin.py`` " "管理员模块文件中用一个 ``admin.site.register()`` 管理员网页注册调用来替代。下" "面这些都是一些更详细的如何重写 ``Admin`` 管理员声明类的新句法。" msgid "Use new inline syntax" msgstr "使用新的行内句法" msgid "" "The new ``edit_inline`` options have all been moved to ``admin.py``. Here's " "an example:" msgstr "" "新的 ``edit_inline`` 行内编辑选项都已经移到 ``admin.py`` 管理员模块中了。下面" "有一个例子:" msgid "Old (0.96)::" msgstr "老版本 (0.96)::" msgid "New (1.0)::" msgstr "新版本 (1.0)::" msgid "See :ref:`admin-inlines` for more details." msgstr "查阅 :ref:`admin-inlines` 管理员行内文档了解更多细节。" msgid "Simplify ``fields``, or use ``fieldsets``" msgstr "简化 ``fields``,或使用 ``fieldsets``" msgid "" "The old ``fields`` syntax was quite confusing, and has been simplified. The " "old syntax still works, but you'll need to use ``fieldsets`` instead." msgstr "" "老的 ``fields`` 句法是非常迷糊的,而且已经被简化过。老的句法依然有效,但你要" "使用 ``fieldsets`` 来代替老旧句法。" msgid "" "More detailed information about the changes and the reasons behind them can " "be found on the `NewformsAdminBranch wiki page`__" msgstr "" "更多关于变更的详细信息以及背后的原因都可以在 `NewformsAdminBranch wiki " "page`__ 新表单管理分支维基百科页面找到" msgid "" "The new admin comes with a ton of new features; you can read about them in " "the :doc:`admin documentation `." msgstr "" "新的管理员功能伴随着许多新特性;你可以在 :doc:`管理员文档 ` 中来阅读有关内容。" msgid "URLs" msgstr "URLs" msgid "Update your root ``urls.py``" msgstr "更新你的根路径 ``urls.py`` 模块" msgid "" "If you're using the admin site, you need to update your root ``urls.py``." msgstr "如果你正在使用后台界面,你需要更新你的根路径``urls.py`` 模块。" msgid "Old (0.96) ``urls.py``::" msgstr "老版本 (0.96) ``urls.py``::" msgid "New (1.0) ``urls.py``::" msgstr "新版本 (1.0) ``urls.py``::" msgid "Views" msgstr "视图" msgid "Use ``django.forms`` instead of ``newforms``" msgstr "使用 ``django.forms`` 来代替 ``newforms`` 用法" msgid "" "Replace ``django.newforms`` with ``django.forms`` -- Django 1.0 renamed the " "``newforms`` module (introduced in 0.96) to plain old ``forms``. The " "``oldforms`` module was also removed." msgstr "" "用 ``django.forms`` 来替换 ``django.newforms`` 用法 -- Django 1.0 版本重命名" "了 ``newforms`` 模块名 (曾用在 0.96 版本的名字) 采用以前用过的 ``forms`` 名" "字。而 ``oldforms`` 模块也会被移除。" msgid "" "If you're already using the ``newforms`` library, and you used our " "recommended ``import`` statement syntax, all you have to do is change your " "import statements." msgstr "" "如果你已经使用 ``newforms`` 库的话,而且你采用了我们所建议的 ``import`` 导入" "语句句法,那么所有你要做的就是改变一下你的导入依据即可。" msgid "Old::" msgstr "老版本::" msgid "New::" msgstr "新版本::" msgid "" "If you're using the old forms system (formerly known as ``django.forms`` and " "``django.oldforms``), you'll have to rewrite your forms. A good place to " "start is the :doc:`forms documentation `" msgstr "" "如果你正在使用老的表单系统 (正规的名字是 ``django.forms`` 和 ``django." "oldforms``),那么你要重写你的表单。良好地开始就是从阅读 :doc:`表单文档 ` 内容" msgid "Handle uploaded files using the new API" msgstr "处理上传文件使用新的 API " msgid "" "Replace use of uploaded files -- that is, entries in ``request.FILES`` -- as " "simple dictionaries with the new :class:`~django.core.files.uploadedfile." "UploadedFile`. The old dictionary syntax no longer works." msgstr "" "代替上传文件的用法 -- 那就是,采用 ``request.FILES`` 文件请求入口 -- 与含有 :" "class:`~django.core.files.uploadedfile.UploadedFile` 文件上传类的简单字典一" "样。老的字典句法不再有效了。" msgid "Thus, in a view like::" msgstr "因此,看起来就像::" msgid "...you'd need to make the following changes:" msgstr "...你需要做出如下变更:" msgid "Old (0.96)" msgstr "老版本 (0.96)" msgid "New (1.0)" msgstr "新版本 (1.0)" msgid "``f['content']``" msgstr "``f['content']``" msgid "``f.read()``" msgstr "``f.read()``" msgid "``f['filename']``" msgstr "``f['filename']``" msgid "``f.name``" msgstr "``f.name``" msgid "``f['content-type']``" msgstr "``f['content-type']``" msgid "``f.content_type``" msgstr "``f.content_type``" msgid "Work with file fields using the new API" msgstr "文件字段使用新API处理" msgid "" "The internal implementation of :class:`django.db.models.FileField` have " "changed. A visible result of this is that the way you access special " "attributes (URL, filename, image size, etc.) of these model fields has " "changed. You will need to make the following changes, assuming your model's :" "class:`~django.db.models.FileField` is called ``myfile``:" msgstr "" "class:`django.db.models.FileField` 的内部实现已更改。一个明显的结果是您访问特" "殊属性(URL, filename, image size, 等等)的方式发生了变化。您需要进行以下更改," "假设您的模型 :class:`~django.db.models.FileField` 调用 ``myfile``:" msgid "``myfile.get_content_filename()``" msgstr "``myfile.get_content_filename()``" msgid "``myfile.content.path``" msgstr "``myfile.content.path``" msgid "``myfile.get_content_url()``" msgstr "``myfile.get_content_url()``" msgid "``myfile.content.url``" msgstr "``myfile.content.url``" msgid "``myfile.get_content_size()``" msgstr "``myfile.get_content_size()``" msgid "``myfile.content.size``" msgstr "``myfile.content.size``" msgid "``myfile.save_content_file()``" msgstr "``myfile.save_content_file()``" msgid "``myfile.content.save()``" msgstr "``myfile.content.save()``" msgid "``myfile.get_content_width()``" msgstr "``myfile.get_content_width()``" msgid "``myfile.content.width``" msgstr "``myfile.content.width``" msgid "``myfile.get_content_height()``" msgstr "``myfile.get_content_height()``" msgid "``myfile.content.height``" msgstr "``myfile.content.height``" msgid "" "Note that the ``width`` and ``height`` attributes only make sense for :class:" "`~django.db.models.ImageField` fields. More details can be found in the :doc:" "`model API ` documentation." msgstr "" "请注意 ``width`` 和 ``height`` 属性仅对:class:`~django.db.models." "ImageField` 字段有意义。更多详细信息可以在 :doc:`模型 API ` 文档中找到。" msgid "Use ``Paginator`` instead of ``ObjectPaginator``" msgstr "使用 ``Paginator`` 而不是 ``ObjectPaginator``" msgid "" "The ``ObjectPaginator`` in 0.96 has been removed and replaced with an " "improved version, :class:`django.core.paginator.Paginator`." msgstr "" "0.96 版本中的 ``ObjectPaginator`` 已被删除,并替换为一个改进版本: class:" "`django.core.paginator.Paginator`。" msgid "Templates" msgstr "模板" msgid "Learn to love autoescaping" msgstr "学会爱上自动转义" msgid "" "By default, the template system now automatically HTML-escapes the output of " "every variable. To learn more, see :ref:`automatic-html-escaping`." msgstr "" "默认情况下,模板系统现在会自动对每个变量的输出进行HTML转义。要了解更多信息," "请参阅 :ref:`automatic-html-escaping`。" msgid "" "To disable auto-escaping for an individual variable, use the :tfilter:`safe` " "filter:" msgstr "要禁用单个变量的自动转义,请使用 :tfilter:`safe` 过滤器:" msgid "" "To disable auto-escaping for an entire template, wrap the template (or just " "a particular section of the template) in the :ttag:`autoescape` tag:" msgstr "" "要禁用整个模板的自动转义,请将模板(或模板的特定部分)包装在 :ttag:" "`autoescape` 标签:" msgid "Less-common changes" msgstr "不常见的变化" msgid "" "The following changes are smaller, more localized changes. They should only " "affect more advanced users, but it's probably worth reading through the list " "and checking your code for these things." msgstr "" "以下更改是较小的、更本地化的更改。它们应该只影响更高级的用户,但是通读列表并" "检查代码中的这些东西可能是值得的。" msgid "Signals" msgstr "信号" msgid "Add ``**kwargs`` to any registered signal handlers." msgstr "将``**kwargs``添加到任何注册的信号处理程序中。" msgid "" "Connect, disconnect, and send signals via methods on the :class:`~django." "dispatch.Signal` object instead of through module methods in ``django." "dispatch.dispatcher``." msgstr "" "通过 :class:`~django.dispatch.Signal` 对象上的方法连接、断开连接和发送信号," "而不是通过 ``django.dispatch.dispatcher`` 中的模块方法。" msgid "" "Remove any use of the ``Anonymous`` and ``Any`` sender options; they no " "longer exist. You can still receive signals sent by any sender by using " "``sender=None``" msgstr "" "移除任何对 ``Anonymous`` 和 ``Any`` 发送者选项的使用;它们不再存在。你仍然可" "以通过使用 ``sender=None`` 接收来自任何发送者的信号。" msgid "" "Make any custom signals you've declared into instances of :class:`django." "dispatch.Signal` instead of anonymous objects." msgstr "" "将你声明的任何自定义信号转换为 :class:`django.dispatch.Signal` 的实例,而不是" "匿名对象。" msgid "Here's quick summary of the code changes you'll need to make:" msgstr "以下是你需要进行的代码更改的快速摘要:" msgid "``def callback(sender)``" msgstr "``def callback(sender)``" msgid "``def callback(sender, **kwargs)``" msgstr "``def callback(sender, **kwargs)``" msgid "``sig = object()``" msgstr "``sig = object()``" msgid "``sig = django.dispatch.Signal()``" msgstr "``sig = django.dispatch.Signal()``" msgid "``dispatcher.connect(callback, sig)``" msgstr "``dispatcher.connect(callback, sig)``" msgid "``sig.connect(callback)``" msgstr "``sig.connect(callback)``" msgid "``dispatcher.send(sig, sender)``" msgstr "``dispatcher.send(sig, sender)``" msgid "``sig.send(sender)``" msgstr "``sig.send(sender)``" msgid "``dispatcher.connect(callback, sig, sender=Any)``" msgstr "``dispatcher.connect(callback, sig, sender=Any)``" msgid "``sig.connect(callback, sender=None)``" msgstr "``sig.connect(callback, sender=None)``" msgid "Comments" msgstr "评论" msgid "" "If you were using Django 0.96's ``django.contrib.comments`` app, you'll need " "to upgrade to the new comments app introduced in 1.0. See the upgrade guide " "for details." msgstr "" "如果你使用的是Django 0.96版的` Django .contrib.comments`应用程序,你需要升级" "到1.0版引入的新评论应用程序。详细信息请参见升级指导书。" msgid "Template tags" msgstr "模板标签" msgid ":ttag:`spaceless` tag" msgstr ":ttag:`spaceless` 标签" msgid "" "The ``spaceless`` template tag now removes *all* spaces between HTML tags, " "instead of preserving a single space." msgstr "" "``spaceless`` 模板标签现在会移除 HTML 标签之间的 *所有* 空格,而不再保留单个" "空格。" msgid "Local flavors" msgstr "本地风味" msgid "U.S. local flavor" msgstr "美国本地风味" msgid "" "``django.contrib.localflavor.usa`` has been renamed to ``django.contrib." "localflavor.us``. This change was made to match the naming scheme of other " "local flavors. To migrate your code, all you need to do is change the " "imports." msgstr "" "``django.contrib.localflavor.usa`` 已重命名为 ``django.contrib.localflavor." "us``。此更改是为了与其他本地化风格的命名方案匹配。要迁移你的代码,你只需要更" "改导入语句。" msgid "Sessions" msgstr "会话" msgid "Getting a new session key" msgstr "获取新的会话密钥" msgid "" "``SessionBase.get_new_session_key()`` has been renamed to " "``_get_new_session_key()``. ``get_new_session_object()`` no longer exists." msgstr "" "``SessionBase.get_new_session_key()`` 已重命名为 ``_get_new_session_key()``。" "``get_new_session_object()`` 不再存在。" msgid "Fixtures" msgstr "辅助工具" msgid "Loading a row no longer calls ``save()``" msgstr "加载一行不再调用\"save()\"" msgid "" "Previously, loading a row automatically ran the model's ``save()`` method. " "This is no longer the case, so any fields (for example: timestamps) that " "were auto-populated by a ``save()`` now need explicit values in any fixture." msgstr "" "以前加载一行数据会自动运行模型的`save()`方法。现在情况不再是这样了,所以任何" "由``save()``自动填充的字段(例如:时间戳)现在都需要在任何fixture中显示值。" msgid "Settings" msgstr "配置" msgid "Better exceptions" msgstr "更好的异常处理" msgid "" "The old :exc:`EnvironmentError` has split into an :exc:`ImportError` when " "Django fails to find the settings module and a :exc:`RuntimeError` when you " "try to reconfigure settings after having already used them." msgstr "" "旧的 :exc:`EnvironmentError` 现已拆分为 :exc:`ImportError` (当 Django 无法找" "到设置模块时)和 :exc:`RuntimeError` (当你尝试在已经使用过设置之后重新配置它" "们时)。" msgid ":setting:`LOGIN_URL` has moved" msgstr ":setting:`LOGIN_URL` 已移动" msgid "" "The :setting:`LOGIN_URL` constant moved from ``django.contrib.auth`` into " "the ``settings`` module. Instead of using ``from django.contrib.auth import " "LOGIN_URL`` refer to :setting:`settings.LOGIN_URL `." msgstr "" ":setting:`LOGIN_URL` 常量已从 ``django.contrib.auth`` 移动到 ``settings`` 模" "块。不再使用 ``from django.contrib.auth import LOGIN_URL``,请改用 :setting:" "`settings.LOGIN_URL `。" msgid ":setting:`APPEND_SLASH` behavior has been updated" msgstr ":setting:`APPEND_SLASH` 的行为已更新。" msgid "" "In 0.96, if a URL didn't end in a slash or have a period in the final " "component of its path, and :setting:`APPEND_SLASH` was True, Django would " "redirect to the same URL, but with a slash appended to the end. Now, Django " "checks to see whether the pattern without the trailing slash would be " "matched by something in your URL patterns. If so, no redirection takes " "place, because it is assumed you deliberately wanted to catch that pattern." msgstr "" "在 0.96 版本中,如果一个 URL 不以斜杠结尾,或者其路径的最后一个组件中没有句" "点,并且 :setting:`APPEND_SLASH` 为 True,Django 会重定向到相同的 URL,但在末" "尾添加斜杠。现在,Django 会检查去掉尾部斜杠的模式是否与你的 URL 模式中的某些" "内容匹配。如果匹配成功,不会进行重定向,因为假定你是有意捕获该模式的。" msgid "" "For most people, this won't require any changes. Some people, though, have " "URL patterns that look like this::" msgstr "" "对大多数人来说,这不需要进行任何更改。然而,有些人的 URL 模式看起来像这样:" msgid "" "Previously, those patterns would have been redirected to have a trailing " "slash. If you always want a slash on such URLs, rewrite the pattern as::" msgstr "" "以前,这些模式会被重定向以添加尾部斜杠。如果你希望这些 URL 始终带有斜杠,请将" "模式改写为:" msgid "Smaller model changes" msgstr "较小的模型更改" msgid "Different exception from ``get()``" msgstr "与``get()``不同的异常" msgid "" "Managers now return a :exc:`~django.core.exceptions.MultipleObjectsReturned` " "exception instead of :exc:`AssertionError`:" msgstr "" "现在,管理器返回 :exc:`~django.core.exceptions.MultipleObjectsReturned` 异" "常,而不再返回 :exc:`AssertionError` 异常:" msgid "``LazyDate`` has been fired" msgstr "``LazyDate`` 已删除。" msgid "The ``LazyDate`` helper class no longer exists." msgstr "``LazyDate`` 帮助类不再存在。" msgid "" "Default field values and query arguments can both be callable objects, so " "instances of ``LazyDate`` can be replaced with a reference to ``datetime." "datetime.now``:" msgstr "" "默认字段值和查询参数都可以是可调用对象,因此可以将 ``LazyDate`` 的实例替换为" "对 ``datetime.datetime.now`` 的引用:" msgid "``DecimalField`` is new, and ``FloatField`` is now a proper float" msgstr "``DecimalField`` 是新的,而 ``FloatField`` 现在是真正的浮点数字段。" msgid "" "If you forget to make this change, you will see errors about ``FloatField`` " "not taking a ``max_digits`` attribute in ``__init__``, because the new " "``FloatField`` takes no precision-related arguments." msgstr "" "如果你忘记进行这个更改,你会看到关于 ``FloatField`` 在 ``__init__`` 中不接受 " "``max_digits`` 属性的错误,因为新的 ``FloatField`` 不接受与精度相关的参数。" msgid "" "If you're using MySQL or PostgreSQL, no further changes are needed. The " "database column types for ``DecimalField`` are the same as for the old " "``FloatField``." msgstr "" "如果你使用的是 MySQL 或 PostgreSQL,不需要进一步的更改。对于 " "``DecimalField``,数据库列类型与旧的 ``FloatField`` 相同。" msgid "" "If you're using SQLite, you need to force the database to view the " "appropriate columns as decimal types, rather than floats. To do this, you'll " "need to reload your data. Do this after you have made the change to using " "``DecimalField`` in your code and updated the Django code." msgstr "" "如果你使用的是 SQLite,你需要强制数据库将相应的列视为十进制类型,而不是浮点" "数。要做到这一点,你需要在对代码进行更改并更新 Django 代码后重新加载数据。" msgid "**Back up your database first!**" msgstr "**首先备份你的数据库!!!!**" msgid "" "For SQLite, this means making a copy of the single file that stores the " "database (the name of that file is the ``DATABASE_NAME`` in your ``settings." "py`` file)." msgstr "" "对于SQLite,这意味着要复制存储数据库的单个文件(该文件的名称是``settings.py``" "文件中的``DATABASE_NAME``)。" msgid "" "To upgrade each application to use a ``DecimalField``, you can do the " "following, replacing ```` in the code below with each app's name:" msgstr "" "要升级每个应用程序以使用 ``DecimalField``,你可以按照以下代码进行操作,将代码" "中的 ```` 替换为每个应用程序的名称:" msgid "Notes:" msgstr "注意:" msgid "" "It's important that you remember to use XML format in the first step of this " "process. We are exploiting a feature of the XML data dumps that makes " "porting floats to decimals with SQLite possible." msgstr "" "在这个过程的第一步中,重要的是记住要使用 XML 格式。我们利用了 XML 数据转储的" "一个特性,使得将浮点数转换为 SQLite 中的十进制数成为可能。" msgid "" "In the second step you will be asked to confirm that you are prepared to " "lose the data for the application(s) in question. Say yes; we'll restore " "this data in the third step." msgstr "" "在第二步中,你将被要求确认你是否准备好丢失相关应用程序的数据。选择是;我们将" "在第三步中恢复这些数据。" msgid "" "``DecimalField`` is not used in any of the apps shipped with Django prior to " "this change being made, so you do not need to worry about performing this " "procedure for any of the standard Django models." msgstr "" "在这个更改之前,Django 附带的应用程序中没有使用 ``DecimalField``,所以你不需" "要担心为任何标准的 Django 模型执行此过程。" msgid "" "If something goes wrong in the above process, just copy your backed up " "database file over the original file and start again." msgstr "" "如果上述过程出现问题,只需将备份的数据库文件复制到原始文件上,然后重新开始。" msgid "Internationalization" msgstr "国际化" msgid ":func:`django.views.i18n.set_language` now requires a POST request" msgstr ":func:`django.views.i18n.set_language` 现在要求使用 POST 请求。" msgid "" "Previously, a GET request was used. The old behavior meant that state (the " "locale used to display the site) could be changed by a GET request, which is " "against the HTTP specification's recommendations. Code calling this view " "must ensure that a POST request is now made, instead of a GET. This means " "you can no longer use a link to access the view, but must use a form " "submission of some kind (e.g. a button)." msgstr "" "以前使用的是 GET 请求。旧的行为意味着可以通过 GET 请求更改状态(用于显示站点" "的区域设置),这违反了 HTTP 规范的建议。调用此视图的代码必须确保现在进行的是 " "POST 请求,而不是 GET 请求。这意味着你不能再使用链接来访问视图,而是必须使用" "某种表单提交方式(例如按钮)。" msgid "``_()`` is no longer in builtins" msgstr "``_()`` 不再位于内置函数中" msgid "" "``_()`` (the callable object whose name is a single underscore) is no longer " "monkeypatched into builtins -- that is, it's no longer available magically " "in every module." msgstr "" "``_()`` (其名称为单个下划线的可调用对象)不再被自动添加到内置函数中,也就是" "说,它不再在每个模块中自动可用。" msgid "" "If you were previously relying on ``_()`` always being present, you should " "now explicitly import ``ugettext`` or ``ugettext_lazy``, if appropriate, and " "alias it to ``_`` yourself::" msgstr "" "如果你之前依赖于 ``_()`` 总是存在,现在应该显式导入 ``ugettext`` 或 " "``ugettext_lazy`` (如果适用),并自己将其别名为 ``_``:" msgid "HTTP request/response objects" msgstr "HTTP 请求/响应对象" msgid "Dictionary access to ``HttpRequest``" msgstr "对于 ``HttpRequest`` 的字典访问:" msgid "" "``HttpRequest`` objects no longer directly support dictionary-style access; " "previously, both ``GET`` and ``POST`` data were directly available on the " "``HttpRequest`` object (e.g., you could check for a piece of form data by " "using ``if 'some_form_key' in request`` or by reading " "``request['some_form_key']``. This is no longer supported; if you need " "access to the combined ``GET`` and ``POST`` data, use ``request.REQUEST`` " "instead." msgstr "" "``HttpRequest`` 对象不再直接支持字典风格的访问;以前,``GET`` 和 ``POST`` 数" "据都可以直接在 ``HttpRequest`` 对象上使用(例如,你可以通过 ``if " "'some_form_key' in request`` 或读取 ``request['some_form_key']`` 来检查表单数" "据。不再支持这种方式;如果你需要访问组合的 ``GET`` 和 ``POST`` 数据,请使用 " "``request.REQUEST``。" msgid "" "It is strongly suggested, however, that you always explicitly look in the " "appropriate dictionary for the type of request you expect to receive " "(``request.GET`` or ``request.POST``); relying on the combined ``request." "REQUEST`` dictionary can mask the origin of incoming data." msgstr "" "然而,强烈建议你始终明确查找你期望接收的请求类型的字典(``request.GET`` 或 " "``request.POST``);依赖于组合的 ``request.REQUEST`` 字典可能会掩盖传入数据的" "来源。" msgid "Accessing ``HTTPResponse`` headers" msgstr "访问``HTTPResponse`` headers" msgid "" "``django.http.HttpResponse.headers`` has been renamed to ``_headers`` and :" "class:`~django.http.HttpResponse` now supports containment checking " "directly. So use ``if header in response:`` instead of ``if header in " "response.headers:``." msgstr "" "``django.http.HttpResponse.headers`` 已重命名为 ``_headers``,并且 :class:" "`~django.http.HttpResponse` 现在直接支持包含检查。所以使用 ``if header in " "response:`` 而不是 ``if header in response.headers:``。" msgid "Generic relations" msgstr "通用关系" msgid "Generic relations have been moved out of core" msgstr "通用关系已从核心中移出。" msgid "" "The generic relation classes -- ``GenericForeignKey`` and " "``GenericRelation`` -- have moved into the :mod:`django.contrib." "contenttypes` module." msgstr "" "通用关联类 -- ``GenericForeignKey`` 和 ``GenericRelation`` -- 已移动到 :mod:" "`django.contrib.contenttypes` 模块。" msgid "Testing" msgstr "测试中" msgid ":meth:`django.test.Client.login` has changed" msgstr ":meth:`django.test.Client.login` 发生了变化" msgid "Management commands" msgstr "管理命令" msgid "Running management commands from your code" msgstr "从你的代码中运行管理命令" msgid ":mod:`django.core.management` has been greatly refactored." msgstr ":mod:`django.core.management` 已经进行了大规模的重构。" msgid "" "Calls to management services in your code now need to use ``call_command``. " "For example, if you have some test code that calls flush and load_data::" msgstr "" "你的代码中对管理服务的调用现在需要使用 ``call_command``。例如,如果你有一些调" "用 flush 和 load_data 的测试代码:" msgid "...you'll need to change this code to read::" msgstr "...你需要更改这段代码为:" msgid "Subcommands must now precede options" msgstr "现在子命令必须在选项之前。" msgid "" "``django-admin.py`` and ``manage.py`` now require subcommands to precede " "options. So:" msgstr "" "``django-admin.py`` 和 ``manage.py`` 现在要求子命令必须在选项之前。因此:" msgid "...no longer works and should be changed to:" msgstr "...不再起作用,应该改为:" msgid "Syndication" msgstr "联合" msgid "``Feed.__init__`` has changed" msgstr "``Feed.__init__`` 发生了变化" msgid "" "The ``__init__()`` method of the syndication framework's ``Feed`` class now " "takes an ``HttpRequest`` object as its second parameter, instead of the " "feed's URL. This allows the syndication framework to work without requiring " "the sites framework. This only affects code that subclasses ``Feed`` and " "overrides the ``__init__()`` method, and code that calls ``Feed.__init__()`` " "directly." msgstr "" "syndication 框架的 ``Feed`` 类的 ``__init__()`` 方法现在将 ``HttpRequest`` 对" "象作为其第二个参数,而不是 feed 的 URL。这允许 syndication 框架在不需要 " "sites 框架的情况下工作。这只影响到子类化 ``Feed`` 并覆盖 ``__init__()`` 方法" "的代码,以及直接调用 ``Feed.__init__()`` 的代码。" msgid "Data structures" msgstr "数据结构" msgid "``SortedDictFromList`` is gone" msgstr "``SortedDictFromList`` 已被移除" msgid "" "``django.newforms.forms.SortedDictFromList`` was removed. ``django.utils." "datastructures.SortedDict`` can now be instantiated with a sequence of " "tuples." msgstr "" "``django.newforms.forms.SortedDictFromList`` 已被移除。``django.utils." "datastructures.SortedDict`` 现在可以通过元组序列进行实例化。" msgid "To update your code:" msgstr "要更新你的代码:" msgid "" "Use ``django.utils.datastructures.SortedDict`` wherever you were using " "``django.newforms.forms.SortedDictFromList``." msgstr "" "在原先使用 ``django.newforms.forms.SortedDictFromList`` 的地方,现在应该使用 " "``django.utils.datastructures.SortedDict``。" msgid "" "Because ``django.utils.datastructures.SortedDict.copy`` doesn't return a " "deepcopy as ``SortedDictFromList.copy()`` did, you will need to update your " "code if you were relying on a deepcopy. Do this by using ``copy.deepcopy`` " "directly." msgstr "" "因为 ``django.utils.datastructures.SortedDict.copy`` 不像 " "``SortedDictFromList.copy()`` 那样返回深拷贝,如果你依赖于深拷贝,你需要更新" "你的代码。通过直接使用 ``copy.deepcopy`` 来实现这一点。" msgid "Database backend functions" msgstr "数据库后端函数" msgid "Database backend functions have been renamed" msgstr "数据库后端函数已经改名。" msgid "" "Almost *all* of the database backend-level functions have been renamed and/" "or relocated. None of these were documented, but you'll need to change your " "code if you're using any of these functions, all of which are in :mod:" "`django.db`:" msgstr "" "几乎所有数据库后端级别的函数都已被重命名和/或移动。虽然这些函数没有被文档化," "但如果你使用了其中的任何一个函数,你需要修改你的代码,所有这些函数都在 :mod:" "`django.db` 中:" msgid "``backend.get_autoinc_sql``" msgstr "``backend.get_autoinc_sql``" msgid "``connection.ops.autoinc_sql``" msgstr "``connection.ops.autoinc_sql``" msgid "``backend.get_date_extract_sql``" msgstr "``backend.get_date_extract_sql``" msgid "``connection.ops.date_extract_sql``" msgstr "``connection.ops.date_extract_sql``" msgid "``backend.get_date_trunc_sql``" msgstr "``backend.get_date_trunc_sql``" msgid "``connection.ops.date_trunc_sql``" msgstr "``connection.ops.date_trunc_sql``" msgid "``backend.get_datetime_cast_sql``" msgstr "``backend.get_datetime_cast_sql``" msgid "``connection.ops.datetime_cast_sql``" msgstr "``connection.ops.datetime_cast_sql``" msgid "``backend.get_deferrable_sql``" msgstr "``backend.get_deferrable_sql``" msgid "``connection.ops.deferrable_sql``" msgstr "``connection.ops.deferrable_sql``" msgid "``backend.get_drop_foreignkey_sql``" msgstr "``backend.get_drop_foreignkey_sql``" msgid "``connection.ops.drop_foreignkey_sql``" msgstr "``connection.ops.drop_foreignkey_sql``" msgid "``backend.get_fulltext_search_sql``" msgstr "``backend.get_fulltext_search_sql``" msgid "``connection.ops.fulltext_search_sql``" msgstr "``connection.ops.fulltext_search_sql``" msgid "``backend.get_last_insert_id``" msgstr "``backend.get_last_insert_id``" msgid "``connection.ops.last_insert_id``" msgstr "``connection.ops.last_insert_id``" msgid "``backend.get_limit_offset_sql``" msgstr "``backend.get_limit_offset_sql``" msgid "``connection.ops.limit_offset_sql``" msgstr "``connection.ops.limit_offset_sql``" msgid "``backend.get_max_name_length``" msgstr "``backend.get_max_name_length``" msgid "``connection.ops.max_name_length``" msgstr "``connection.ops.max_name_length``" msgid "``backend.get_pk_default_value``" msgstr "``backend.get_pk_default_value``" msgid "``connection.ops.pk_default_value``" msgstr "``connection.ops.pk_default_value``" msgid "``backend.get_random_function_sql``" msgstr "``backend.get_random_function_sql``" msgid "``connection.ops.random_function_sql``" msgstr "``connection.ops.random_function_sql``" msgid "``backend.get_sql_flush``" msgstr "``backend.get_sql_flush``" msgid "``connection.ops.sql_flush``" msgstr "``connection.ops.sql_flush``" msgid "``backend.get_sql_sequence_reset``" msgstr "``backend.get_sql_sequence_reset``" msgid "``connection.ops.sequence_reset_sql``" msgstr "``connection.ops.sequence_reset_sql``" msgid "``backend.get_start_transaction_sql``" msgstr "``backend.get_start_transaction_sql``" msgid "``connection.ops.start_transaction_sql``" msgstr "``connection.ops.start_transaction_sql``" msgid "``backend.get_tablespace_sql``" msgstr "``backend.get_tablespace_sql``" msgid "``connection.ops.tablespace_sql``" msgstr "``connection.ops.tablespace_sql``" msgid "``backend.quote_name``" msgstr "``backend.quote_name``" msgid "``connection.ops.quote_name``" msgstr "``connection.ops.quote_name``" msgid "``backend.get_query_set_class``" msgstr "``backend.get_query_set_class``" msgid "``connection.ops.query_set_class``" msgstr "``connection.ops.query_set_class``" msgid "``backend.get_field_cast_sql``" msgstr "``backend.get_field_cast_sql``" msgid "``connection.ops.field_cast_sql``" msgstr "``connection.ops.field_cast_sql``" msgid "``backend.get_drop_sequence``" msgstr "``backend.get_drop_sequence``" msgid "``connection.ops.drop_sequence_sql``" msgstr "``connection.ops.drop_sequence_sql``" msgid "``backend.OPERATOR_MAPPING``" msgstr "``backend.OPERATOR_MAPPING``" msgid "``connection.operators``" msgstr "``connection.operators``" msgid "``backend.allows_group_by_ordinal``" msgstr "``backend.allows_group_by_ordinal``" msgid "``connection.features.allows_group_by_ordinal``" msgstr "``connection.features.allows_group_by_ordinal``" msgid "``backend.allows_unique_and_pk``" msgstr "``backend.allows_unique_and_pk``" msgid "``connection.features.allows_unique_and_pk``" msgstr "``connection.features.allows_unique_and_pk``" msgid "``backend.autoindexes_primary_keys``" msgstr "``backend.autoindexes_primary_keys``" msgid "``connection.features.autoindexes_primary_keys``" msgstr "``connection.features.autoindexes_primary_keys``" msgid "``backend.needs_datetime_string_cast``" msgstr "``backend.needs_datetime_string_cast``" msgid "``connection.features.needs_datetime_string_cast``" msgstr "``connection.features.needs_datetime_string_cast``" msgid "``backend.needs_upper_for_iops``" msgstr "``backend.needs_upper_for_iops``" msgid "``connection.features.needs_upper_for_iops``" msgstr "``connection.features.needs_upper_for_iops``" msgid "``backend.supports_constraints``" msgstr "``backend.supports_constraints``" msgid "``connection.features.supports_constraints``" msgstr "``connection.features.supports_constraints``" msgid "``backend.supports_tablespaces``" msgstr "``backend.supports_tablespaces``" msgid "``connection.features.supports_tablespaces``" msgstr "``connection.features.supports_tablespaces``" msgid "``backend.uses_case_insensitive_names``" msgstr "``backend.uses_case_insensitive_names``" msgid "``connection.features.uses_case_insensitive_names``" msgstr "``connection.features.uses_case_insensitive_names``" msgid "``backend.uses_custom_queryset``" msgstr "``backend.uses_custom_queryset``" msgid "``connection.features.uses_custom_queryset``" msgstr "``connection.features.uses_custom_queryset``" msgid "Django 1.0.1 release notes" msgstr "Django 1.0.1 版本发行说明" msgid "Welcome to Django 1.0.1!" msgstr "欢迎来到 Django 1.0.1 版本!" msgid "" "This is the first \"bugfix\" release in the Django 1.0 series, improving the " "stability and performance of the Django 1.0 codebase. As such, Django 1.0.1 " "contains no new features (and, pursuant to :doc:`our compatibility policy `, maintains backwards compatibility with Django 1.0), " "but does contain a number of fixes and other improvements. Django 1.0.1 is a " "recommended upgrade for any development or deployment currently using or " "targeting Django 1.0." msgstr "" "这是 Django 1.0 系列的第一个“修复错误”版本,改进了 Django 1.0 代码库的稳定性" "和性能。因此,Django 1.0.1 不包含新功能(根据 :doc:`我们的兼容性政策 `,保持了与 Django 1.0 的向后兼容性),但包含了许多修复和其他" "改进。Django 1.0.1 是任何当前使用或针对 Django 1.0 的开发或部署的推荐升级版" "本。" msgid "Fixes and improvements in Django 1.0.1" msgstr "Django 1.0.1 中的修正和改进" msgid "" "Django 1.0.1 contains over two hundred fixes to the original Django 1.0 " "codebase; full details of every fix are available in `the history of the 1.0." "X branch`_, but here are some of the highlights:" msgstr "" "Django 1.0.1 包含了对原始 Django 1.0 代码库的两百多个修复;关于每个修复的详细" "信息可以在 `1.0.X 分支的历史记录`_ 中找到,以下是一些亮点:" msgid "" "Several fixes in ``django.contrib.comments``, pertaining to RSS feeds of " "comments, default ordering of comments and the XHTML and " "internationalization of the default templates for comments." msgstr "" "在 ``django.contrib.comments`` 中进行了一些修复,涉及到评论的 RSS 订阅、评论" "的默认排序以及评论默认模板的 XHTML 和国际化。" msgid "" "Multiple fixes for Django's support of Oracle databases, including " "pagination support for GIS QuerySets, more efficient slicing of results and " "improved introspection of existing databases." msgstr "" "对于 Django 对 Oracle 数据库的支持进行了多个修复,包括对 GIS QuerySets 的分页" "支持,更高效的结果切片和对现有数据库的改进的内省。" msgid "" "Several fixes for query support in the Django object-relational mapper, " "including repeated setting and resetting of ordering and fixes for working " "with ``INSERT``-only queries." msgstr "" "Django 对象关系映射中的查询支持修复,包括重复设置和重置排序以及与仅支持 " "``INSERT`` 查询的修复。" msgid "Multiple fixes for inline forms in formsets." msgstr "对于表单集中的内联表单进行了多个修复。" msgid "" "Multiple fixes for ``unique`` and ``unique_together`` model constraints in " "automatically-generated forms." msgstr "" "对于自动生成的表单中的 ``unique`` 和 ``unique_together`` 模型约束进行了多个修" "复。" msgid "" "Fixed support for custom callable ``upload_to`` declarations when handling " "file uploads through automatically-generated forms." msgstr "" "修复了通过自动生成的表单处理文件上传时,对自定义可调用的 ``upload_to`` 声明的" "支持。" msgid "" "Fixed support for sorting an admin change list based on a callable " "attributes in ``list_display``." msgstr "修复了基于`list_display`中的可调用属性来排序管理更改列表的支持。" msgid "" "A fix to the application of autoescaping for literal strings passed to the " "``join`` template filter. Previously, literal strings passed to ``join`` " "were automatically escaped, contrary to :ref:`the documented behavior for " "autoescaping and literal strings `. " "Literal strings passed to ``join`` are no longer automatically escaped, " "meaning you must now manually escape them; this is an incompatibility if you " "were relying on this bug, but not if you were relying on escaping behaving " "as documented." msgstr "" "修复了自动转义应用于传递给 ``join`` 模板过滤器的文字字符串的问题。以前,传递" "给 ``join`` 的文字字符串会自动进行转义,与 :ref:`文档中自动转义和文字字符串的" "记录行为 ` 相矛盾。现在,传递给 " "``join`` 的文字字符串不再自动进行转义,这意味着你现在必须手动进行转义;如果你" "依赖于这个错误,这是一个不兼容的变化,但如果你依赖于转义的行为与文档一致,那" "么就没有问题。" msgid "" "Improved and expanded translation files for many of the languages Django " "supports by default." msgstr "对 Django 默认支持的许多语言进行了改进和扩展的翻译文件。" msgid "" "And as always, a large number of improvements to Django's documentation, " "including both corrections to existing documents and expanded and new " "documentation." msgstr "" "一如既往地,对 Django 的文档进行了大量改进,包括对现有文档的修正和扩展以及全" "新的文档。" msgid "Django 1.0.2 release notes" msgstr "Django 1.0.2 版本发行说明" msgid "Welcome to Django 1.0.2!" msgstr "欢迎来到 Django 1.0.2 版本!" msgid "" "This is the second \"bugfix\" release in the Django 1.0 series, improving " "the stability and performance of the Django 1.0 codebase. As such, Django " "1.0.2 contains no new features (and, pursuant to :doc:`our compatibility " "policy `, maintains backwards compatibility with Django " "1.0.0), but does contain a number of fixes and other improvements. Django " "1.0.2 is a recommended upgrade for any development or deployment currently " "using or targeting Django 1.0." msgstr "" "这是 Django 1.0 系列的第二个“修复错误”版本,改进了 Django 1.0 代码库的稳定性" "和性能。因此,Django 1.0.2 不包含新功能(根据我们的兼容性政策,保持了与 " "Django 1.0.0 的向后兼容性),但包含了许多修复和其他改进。Django 1.0.2 是任何" "当前使用或针对 Django 1.0 的开发或部署的推荐升级版本。" msgid "Fixes and improvements in Django 1.0.2" msgstr "Django 1.0.2 中的修正和改进" msgid "" "The primary reason behind this release is to remedy an issue in the recently-" "released Django 1.0.1; the packaging scripts used for Django 1.0.1 omitted " "some directories from the final release package, including one directory " "required by ``django.contrib.gis`` and part of Django's unit-test suite." msgstr "" "这个版本发布的主要原因是修复了最近发布的 Django 1.0.1 中的一个问题;Django " "1.0.1 使用的打包脚本在最终发布包中省略了一些目录,包括 ``django.contrib." "gis`` 需要的一个目录以及 Django 单元测试套件的一部分。" msgid "" "Django 1.0.2 contains updated packaging scripts, and the release package " "contains the directories omitted from Django 1.0.1. As such, this release " "contains all of the fixes and improvements from Django 1.0.1; see :doc:`the " "Django 1.0.1 release notes ` for details." msgstr "" "Django 1.0.2 包含更新的打包脚本,并且发布包中包含了在 Django 1.0.1 中遗漏的目" "录。因此,这个版本包含了来自 Django 1.0.1 的所有修复和改进;请查看 :doc:" "`Django 1.0.1 发布说明 ` 以获取详细信息。" msgid "Additionally, in the period since Django 1.0.1 was released:" msgstr "此外,在发布 Django 1.0.1 之后的一段时间里:" msgid "Updated Hebrew and Danish translations have been added." msgstr "已添加更新的希伯来语和丹麦语翻译。" msgid "" "The default ``__repr__`` method of Django models has been made more robust " "in the face of bad Unicode data coming from the ``__unicode__`` method; " "rather than raise an exception in such cases, ``repr()`` will now contain " "the string \"[Bad Unicode data]\" in place of the invalid Unicode." msgstr "" "Django 模型的默认 ``__repr__`` 方法在处理来自 ``__unicode__`` 方法的坏 " "Unicode 数据时变得更加健壮;在这种情况下,不会引发异常,而是 ``repr()`` 将包" "含字符串 \"[Bad Unicode data]\" 来替代无效的 Unicode。" msgid "" "A bug involving the interaction of Django's ``SafeUnicode`` class and the " "MySQL adapter has been resolved; ``SafeUnicode`` instances (generated, for " "example, by template rendering) can now be assigned to model attributes and " "saved to MySQL without requiring an explicit intermediate cast to " "``unicode``." msgstr "" "已解决了与 Django 的 ``SafeUnicode`` 类和 MySQL 适配器交互的一个 bug;现在可" "以将 ``SafeUnicode`` 实例(例如,由模板渲染生成)分配给模型属性并保存到 " "MySQL,而无需显式的中间强制转换为 ``unicode``。" msgid "" "A bug affecting filtering on a nullable ``DateField`` in SQLite has been " "resolved." msgstr "已解决了在 SQLite 中对可为空的 ``DateField`` 进行过滤时出现的 bug。" msgid "" "Several updates and improvements have been made to Django's documentation." msgstr "对 Django 的文档进行了多次更新和改进。" msgid "Django 1.1 release notes" msgstr "Django 1.1 版本发行说明" msgid "July 29, 2009" msgstr "2009 年 7 月 29 日" msgid "Welcome to Django 1.1!" msgstr "欢迎来到 Django 1.1 版本!" msgid "" "Django 1.1 includes a number of nifty :ref:`new features `, " "lots of bug fixes, and an easy upgrade path from Django 1.0." msgstr "" "Django 1.1 包含了许多 :ref:`新功能 `、大量的 bug 修复,以及从 " "Django 1.0 升级的简便路径。" msgid "Backwards-incompatible changes in 1.1" msgstr "1.1 中的不向后兼容的变更" msgid "" "Django has a policy of :doc:`API stability `. This " "means that, in general, code you develop against Django 1.0 should continue " "to work against 1.1 unchanged. However, we do sometimes make backwards-" "incompatible changes if they're necessary to resolve bugs, and there are a " "handful of such (minor) changes between Django 1.0 and Django 1.1." msgstr "" "Django 具有一项 :doc:`API 稳定性 ` 的政策。这意味着通常" "情况下,你在 Django 1.0 上开发的代码应该可以在 1.1 上无需修改继续运行。然而," "如果需要解决 bug,我们有时会进行不兼容的变更,而在 Django 1.0 和 Django 1.1 " "之间存在一些这样的(小的)变更。" msgid "" "Before upgrading to Django 1.1 you should double-check that the following " "changes don't impact you, and upgrade your code if they do." msgstr "" "在升级到 Django 1.1 之前,你应该仔细检查以下更改是否会影响你的代码,并在需要" "时进行代码升级。" msgid "Changes to constraint names" msgstr "约束名称的更改" msgid "" "Django 1.1 modifies the method used to generate database constraint names so " "that names are consistent regardless of machine word size. This change is " "backwards incompatible for some users." msgstr "" "Django 1.1 修改了生成数据库约束名称的方法,使得名称在不同机器字长下保持一致。" "这个改变对一些用户来说是不兼容的。" msgid "" "If you are using a 32-bit platform, you're off the hook; you'll observe no " "differences as a result of this change." msgstr "" "如果你使用的是 32 位平台,你就不用担心了;你不会因为这个改变而观察到任何差" "异。" msgid "" "However, **users on 64-bit platforms may experience some problems** using " "the ``reset`` management command. Prior to this change, 64-bit platforms " "would generate a 64-bit, 16 character digest in the constraint name; for " "example:" msgstr "" "然而,**在 64 位平台上的用户可能会在使用 ``reset`` 管理命令时遇到一些问题**。" "在这个更改之前,64 位平台会生成一个 64 位、16 个字符的约束名称;例如:" msgid "" "Following this change, all platforms, regardless of word size, will generate " "a 32-bit, 8 character digest in the constraint name; for example:" msgstr "" "在这个改变之后,所有平台(无论字长如何)都将在约束名称中生成一个 32 位、8 个" "字符的摘要;例如:" msgid "" "As a result of this change, you will not be able to use the ``reset`` " "management command on any table made by a 64-bit machine. This is because " "the new generated name will not match the historically generated name; as a " "result, the SQL constructed by the reset command will be invalid." msgstr "" "由于这个更改,你将无法在由 64 位机器创建的任何表上使用 ``reset`` 管理命令。这" "是因为新生成的名称将不匹配历史生成的名称;因此,reset 命令构建的 SQL 将无效。" msgid "" "If you need to reset an application that was created with 64-bit " "constraints, you will need to manually drop the old constraint prior to " "invoking ``reset``." msgstr "" "如果你需要重置一个使用 64 位约束创建的应用程序,你需要在调用 ``reset`` 命令之" "前手动删除旧的约束。" msgid "Test cases are now run in a transaction" msgstr "现在测试用例在一个事务中运行" msgid "" "Django 1.1 runs tests inside a transaction, allowing better test performance " "(see `test performance improvements`_ for details)." msgstr "" "Django 1.1 在事务内运行测试,从而提高了测试性能(详细信息请参见 `测试性能改进" "`_)。" msgid "" "This change is slightly backwards incompatible if existing tests need to " "test transactional behavior, if they rely on invalid assumptions about the " "test environment, or if they require a specific test case ordering." msgstr "" "如果现有的测试需要测试事务行为,如果它们依赖于对测试环境的无效假设,或者如果" "它们需要特定的测试用例顺序,那么这个改变在某种程度上是不兼容的。" msgid "" "For these cases, :class:`~django.test.TransactionTestCase` can be used " "instead. This is a just a quick fix to get around test case errors revealed " "by the new rollback approach; in the long-term tests should be rewritten to " "correct the test case." msgstr "" "对于这些情况,可以使用 :class:`~django.test.TransactionTestCase`。这只是一个" "快速的修复方法,用来解决新的回滚方式暴露出的测试用例错误;从长远来看,应该重" "新编写测试用例以纠正问题。" msgid "Removed ``SetRemoteAddrFromForwardedFor`` middleware" msgstr "移除了 ``SetRemoteAddrFromForwardedFor`` 中间件" msgid "" "For convenience, Django 1.0 included an optional middleware class -- " "``django.middleware.http.SetRemoteAddrFromForwardedFor`` -- which updated " "the value of ``REMOTE_ADDR`` based on the HTTP ``X-Forwarded-For`` header " "commonly set by some proxy configurations." msgstr "" "为了方便,Django 1.0 包括了一个可选的中间件类 -- ``django.middleware.http." "SetRemoteAddrFromForwardedFor`` -- 该类基于一些代理配置常常设置的 HTTP ``X-" "Forwarded-For`` 头部更新了 ``REMOTE_ADDR`` 的值。" msgid "" "It has been demonstrated that this mechanism cannot be made reliable enough " "for general-purpose use, and that (despite documentation to the contrary) " "its inclusion in Django may lead application developers to assume that the " "value of ``REMOTE_ADDR`` is \"safe\" or in some way reliable as a source of " "authentication." msgstr "" "已经证明这个机制不能够可靠到足以用于通用用途,并且(尽管文档中有不同的说明)" "它包含在 Django 中可能会导致应用程序开发者假设 ``REMOTE_ADDR`` 的值是“安全" "的”或以某种方式可靠作为身份验证的来源。" msgid "" "While not directly a security issue, we've decided to remove this middleware " "with the Django 1.1 release. It has been replaced with a class that does " "nothing other than raise a ``DeprecationWarning``." msgstr "" "尽管这不是一个直接的安全问题,但我们决定在 Django 1.1 版本中删除这个中间件。" "它已被替换为一个什么都不做,只会引发 ``DeprecationWarning`` 的类。" msgid "If you've been relying on this middleware, the easiest upgrade path is:" msgstr "如果你一直依赖这个中间件,最简单的升级路径是:" msgid "Examine `the code as it existed before it was removed`__." msgstr "检查 `在被移除之前的代码`__。" msgid "" "Verify that it works correctly with your upstream proxy, modifying it to " "support your particular proxy (if necessary)." msgstr "验证它是否与你的上游代理正确工作,并根据需要修改以支持你的特定代理。" msgid "" "Introduce your modified version of ``SetRemoteAddrFromForwardedFor`` as a " "piece of middleware in your own project." msgstr "" "在你自己的项目中将我修改过的版本的 ``SetRemoteAddrFromForwardedFor`` 作为中间" "件引入。" msgid "Names of uploaded files are available later" msgstr "上传文件的名称稍后可用" msgid "" "In Django 1.0, files uploaded and stored in a model's :class:`FileField` " "were saved to disk before the model was saved to the database. This meant " "that the actual file name assigned to the file was available before saving. " "For example, it was available in a model's pre-save signal handler." msgstr "" "在 Django 1.0 中,上传并存储在模型的 :class:`FileField` 中的文件在模型保存到" "数据库之前会被保存到磁盘。这意味着在保存之前可以获取分配给文件的实际文件名。" "例如,在模型的预保存信号处理程序中可以获取到它。" msgid "" "In Django 1.1 the file is saved as part of saving the model in the database, " "so the actual file name used on disk cannot be relied on until *after* the " "model has been saved." msgstr "" "在 Django 1.1 中,文件会作为保存模型到数据库的一部分而被保存,因此在模型被保" "存之前不能依赖于磁盘上使用的实际文件名。" msgid "Changes to how model formsets are saved" msgstr "模型表单集的保存方式的变更" msgid "" "In Django 1.1, :class:`~django.forms.models.BaseModelFormSet` now calls " "``ModelForm.save()``." msgstr "" "在Django 1.1中,:class:`~ Django .forms.models. `BaseModelFormSet`现在调用" "`ModelForm.save()`。" msgid "" "This is backwards-incompatible if you were modifying ``self.initial`` in a " "model formset's ``__init__``, or if you relied on the internal " "``_total_form_count`` or ``_initial_form_count`` attributes of BaseFormSet. " "Those attributes are now public methods." msgstr "" "如果你在模型表单集的 ``__init__`` 中修改了 ``self.initial``,或者依赖于 " "BaseFormSet 的内部属性 ``_total_form_count`` 或 ``_initial_form_count``,这是" "不兼容的。现在这些属性已经变成了公共方法。" msgid "Fixed the ``join`` filter's escaping behavior" msgstr "修复了\"join\"过滤器的转义行为" msgid "" "The :tfilter:`join` filter no longer escapes the literal value that is " "passed in for the connector." msgstr ":tfilter:`join` 过滤器不再转义传递给连接器的字面量。" msgid "" "This is backwards incompatible for the special situation of the literal " "string containing one of the five special HTML characters. Thus, if you were " "writing ``{{ foo|join:\"&\" }}``, you now have to write ``{{ foo|join:\"&" "\" }}``." msgstr "" "这对于包含五个特殊 HTML 字符之一的文字字符串的特殊情况是不兼容的。因此,如果" "你之前写的是 ``{{ foo|join:\"&\" }}``,现在你必须写成 ``{{ foo|join:\"&" "\" }}``。" msgid "" "The previous behavior was a bug and contrary to what was documented and " "expected." msgstr "先前的行为是一个错误,并且与所记录和预期的不符。" msgid "Permanent redirects and the ``redirect_to()`` generic view" msgstr "永久重定向和`redirect_to()`通用视图" msgid "" "Django 1.1 adds a ``permanent`` argument to the ``django.views.generic." "simple.redirect_to()`` view. This is technically backwards-incompatible if " "you were using the ``redirect_to`` view with a format-string key called " "'permanent', which is highly unlikely." msgstr "" "Django 1.1 在 ``django.views.generic.simple.redirect_to()`` 视图中添加了一个 " "``permanent`` 参数。如果你使用 ``redirect_to`` 视图并将格式字符串键命名为 " "'permanent',这在技术上是向后不兼容的,这是极不可能的。" msgid "Features deprecated in 1.1" msgstr "在 1.1 中被废弃的功能" msgid "One feature has been marked as deprecated in Django 1.1:" msgstr "在 Django 1.1 中,一个功能已被标记为废弃。" msgid "" "You should no longer use ``AdminSite.root()`` to register that admin views. " "That is, if your URLconf contains the line::" msgstr "" "你不应再使用 ``AdminSite.root()`` 来注册管理员视图。也就是说,如果你的 URL 配" "置包含以下行:" msgid "You should change it to read::" msgstr "你应该将其修改为如下所示:" msgid "" "You should begin to remove use of this feature from your code immediately." msgstr "你应立即开始从你的代码中移除对该功能的使用。" msgid "" "``AdminSite.root`` will raise a ``PendingDeprecationWarning`` if used in " "Django 1.1. This warning is hidden by default. In Django 1.2, this warning " "will be upgraded to a ``DeprecationWarning``, which will be displayed " "loudly. Django 1.3 will remove ``AdminSite.root()`` entirely." msgstr "" "在 Django 1.1 中,如果使用 ``AdminSite.root``,将会引发一个 " "``PendingDeprecationWarning`` 警告,默认情况下这个警告是隐藏的。在 Django " "1.2 中,这个警告将升级为 ``DeprecationWarning``,并且会被明显显示出来。在 " "Django 1.3 中,将完全删除 ``AdminSite.root()``。" msgid "" "For more details on our deprecation policies and strategy, see :doc:`/" "internals/release-process`." msgstr "" "有关我们的废弃政策和策略的更多详细信息,请参阅 :doc:`/internals/release-" "process`。" msgid "What's new in Django 1.1" msgstr "Django 1.1 中的新功能有哪些?" msgid "" "Quite a bit: since Django 1.0, we've made 1,290 code commits, fixed 1,206 " "bugs, and added roughly 10,000 lines of documentation." msgstr "" "相当多:自 Django 1.0 以来,我们进行了 1290 次代码提交,修复了 1206 个错误," "并增加了大约 10000 行文档。" msgid "The major new features in Django 1.1 are:" msgstr "Django 1.1 的主要新功能有:" msgid "ORM improvements" msgstr "ORM 改进" msgid "" "Two major enhancements have been added to Django's object-relational mapper " "(ORM): aggregate support, and query expressions." msgstr "" "Django 的对象关系映射器(ORM)已经增加了两个重要的增强功能:聚合支持和查询表" "达式。" msgid "Aggregate support" msgstr "聚合支持" msgid "" "It's now possible to run SQL aggregate queries (i.e. ``COUNT()``, ``MAX()``, " "``MIN()``, etc.) from within Django's ORM. You can choose to either return " "the results of the aggregate directly, or else annotate the objects in a :" "class:`~django.db.models.query.QuerySet` with the results of the aggregate " "query." msgstr "" "现在可以从 Django 的 ORM 中运行 SQL 聚合查询(例如 ``COUNT()``、``MAX()``、" "``MIN()`` 等)。你可以选择直接返回聚合的结果,或者在 :class:`~django.db." "models.query.QuerySet` 中使用聚合查询的结果来注释对象。" msgid "" "This feature is available as new :meth:`~django.db.models.query.QuerySet." "aggregate` and :meth:`~django.db.models.query.QuerySet.annotate` methods, " "and is covered in detail in :doc:`the ORM aggregation documentation `." msgstr "" "这个功能可以通过新的 :meth:`~django.db.models.query.QuerySet.aggregate` 和 :" "meth:`~django.db.models.query.QuerySet.annotate` 方法来使用,详细信息可以在 :" "doc:`ORM 聚合文档 ` 中找到。" msgid "Query expressions" msgstr "查询表达式" msgid "" "Queries can now refer to another field on the query and can traverse " "relationships to refer to fields on related models. This is implemented in " "the new :class:`~django.db.models.F` object; for full details, including " "examples, consult the :class:`F expressions documentation `." msgstr "" "现在查询可以引用查询中的另一个字段,并且可以遍历关系引用相关模型上的字段。这" "是通过新的 :class:`~django.db.models.F` 对象实现的;有关完整的详细信息,包括" "示例,请查阅 :class:`F 表达式文档 `。" msgid "Model improvements" msgstr "模型改进" msgid "A number of features have been added to Django's model layer:" msgstr "Django 的模型层已添加了多项功能:" msgid "\"Unmanaged\" models" msgstr "\"未管理\"模型" msgid "" "You can now control whether or not Django manages the life-cycle of the " "database tables for a model using the :attr:`~Options.managed` model option. " "This defaults to ``True``, meaning that Django will create the appropriate " "database tables in ``syncdb`` and remove them as part of the ``reset`` " "command. That is, Django *manages* the database table's lifecycle." msgstr "" "现在,你可以使用 :attr:`~Options.managed` 模型选项来控制 Django 是否管理模型" "的数据库表的生命周期。默认值是 ``True``,这意味着 Django 将在 ``syncdb`` 中创" "建相应的数据库表,并在 ``reset`` 命令中删除它们。换句话说,Django *管理* 数据" "库表的生命周期。" msgid "" "If you set this to ``False``, however, no database table creating or " "deletion will be automatically performed for this model. This is useful if " "the model represents an existing table or a database view that has been " "created by some other means." msgstr "" "然而,如果将其设置为 ``False``,则不会自动执行该模型的数据库表创建或删除操" "作。如果该模型代表已存在的表格或者是由其他方式创建的数据库视图,这会很有用。" msgid "" "For more details, see the documentation for the :attr:`~Options.managed` " "option." msgstr "更多详细信息,请查看 :attr:`~Options.managed` 选项的文档。" msgid "Proxy models" msgstr "代理模型" msgid "" "You can now create :ref:`proxy models `: subclasses of " "existing models that only add Python-level (rather than database-level) " "behavior and aren't represented by a new table. That is, the new model is a " "*proxy* for some underlying model, which stores all the real data." msgstr "" "现在你可以创建 :ref:`代理模型 `:这些是现有模型的子类,只添加 " "Python 级别(而不是数据库级别)的行为,并且不代表一个新的表格。也就是说,新模" "型是某个底层模型的 *代理*,而底层模型存储了所有真实数据。" msgid "" "All the details can be found in the :ref:`proxy models documentation `. This feature is similar on the surface to unmanaged models, so the " "documentation has an explanation of :ref:`how proxy models differ from " "unmanaged models `." msgstr "" "所有详细信息可以在 :ref:`代理模型文档 ` 中找到。这个功能在表面" "上与未管理的模型相似,因此文档中有一个解释 :ref:`代理模型与未管理模型的不同之" "处 `。" msgid "Deferred fields" msgstr "延迟字段" msgid "" "In some complex situations, your models might contain fields which could " "contain a lot of data (for example, large text fields), or require expensive " "processing to convert them to Python objects. If you know you don't need " "those particular fields, you can now tell Django not to retrieve them from " "the database." msgstr "" "在某些复杂情况下,你的模型可能包含大量数据的字段(例如,大型文本字段),或者" "需要耗费大量计算资源将其转换为 Python 对象。如果你确定不需要这些特定字段,现" "在可以告诉 Django 不从数据库中检索它们。" msgid "" "You'll do this with the new queryset methods :meth:`~django.db.models.query." "QuerySet.defer` and :meth:`~django.db.models.query.QuerySet.only`." msgstr "" "你可以使用新的查询集方法 :meth:`~django.db.models.query.QuerySet.defer` 和 :" "meth:`~django.db.models.query.QuerySet.only` 来实现这一点。" msgid "Testing improvements" msgstr "测试改进" msgid "" "A few notable improvements have been made to the :doc:`testing framework `." msgstr ":doc:`测试框架 ` 中已经进行了一些显著的改进。" msgid "Test performance improvements" msgstr "测试性能改进" msgid "" "Tests written using Django's :doc:`testing framework ` now run dramatically faster (as much as 10 times faster in many " "cases)." msgstr "" "使用 Django 的 :doc:`测试框架 ` 编写的测试现在运行速度" "大幅提高(在许多情况下提高了多达 10 倍)。" msgid "" "This was accomplished through the introduction of transaction-based tests: " "when using :class:`django.test.TestCase`, your tests will now be run in a " "transaction which is rolled back when finished, instead of by flushing and " "re-populating the database. This results in an immense speedup for most " "types of unit tests. See the documentation for :class:`TestCase` and :class:" "`TransactionTestCase` for a full description, and some important notes on " "database support." msgstr "" "通过引入基于事务的测试来实现的:当使用 :class:`django.test.TestCase` 时,你的" "测试现在将在一个事务中运行,测试结束后将回滚事务,而不是刷新和重新填充数据" "库。这对于大多数类型的单元测试来说会极大地提速。请查看 :class:`TestCase` 和 :" "class:`TransactionTestCase` 的文档以获取完整的描述,以及关于数据库支持的一些" "重要说明。" msgid "Test client improvements" msgstr "测试客户端改进" msgid "" "A couple of small -- but highly useful -- improvements have been made to the " "test client:" msgstr "测试客户端进行了几项小而非常有用的改进:" msgid "" "The test :class:`Client` now can automatically follow redirects with the " "``follow`` argument to :meth:`Client.get` and :meth:`Client.post`. This " "makes testing views that issue redirects simpler." msgstr "" "测试中的 :class:`Client` 现在可以通过 :meth:`Client.get` 和 :meth:`Client." "post` 的 ``follow`` 参数自动跟随重定向。这使得测试发出重定向的视图更加简单。" msgid "" "It's now easier to get at the template context in the response returned the " "test client: you'll simply access the context as ``request.context[key]``. " "The old way, which treats ``request.context`` as a list of contexts, one for " "each rendered template in the inheritance chain, is still available if you " "need it." msgstr "" "现在更容易获取测试客户端返回的响应中的模板上下文:你只需将上下文作为 " "``request.context[key]`` 来访问。如果需要,仍然可以使用旧方式,该方式将 " "``request.context`` 视为继承链中每个渲染模板的上下文列表。" msgid "New admin features" msgstr "新的管理功能" msgid "" "Django 1.1 adds a couple of nifty new features to Django's admin interface:" msgstr "Django 1.1 在 Django 的管理界面中增加了几个很棒的新功能:" msgid "Editable fields on the change list" msgstr "在更改列表上的可编辑字段" msgid "" "You can now make fields editable on the admin list views via the new :ref:" "`list_editable ` admin option. These fields will show " "up as form widgets on the list pages, and can be edited and saved in bulk." msgstr "" "现在你可以通过新的 :ref:`list_editable ` 管理选项在管理" "员列表视图上使字段可编辑。这些字段将显示为表单小部件在列表页面上,并可以批量" "编辑和保存。" msgid "Admin \"actions\"" msgstr "管理界面的\"动作\"" msgid "" "You can now define :doc:`admin actions ` that " "can perform some action to a group of models in bulk. Users will be able to " "select objects on the change list page and then apply these bulk actions to " "all selected objects." msgstr "" "现在你可以定义可以批量对一组模型执行某些操作的 :doc:`管理员操作 `。用户将能够在更改列表页面上选择对象,然后将这些批量操" "作应用于所有选定的对象。" msgid "" "Django ships with one pre-defined admin action to delete a group of objects " "in one fell swoop." msgstr "Django 默认提供了一个预定义的管理动作,可以一次性删除一组对象。" msgid "Conditional view processing" msgstr "条件视图处理" msgid "" "Django now has much better support for :doc:`conditional view processing ` using the standard ``ETag`` and ``Last-" "Modified`` HTTP headers. This means you can now easily short-circuit view " "processing by testing less-expensive conditions. For many views this can " "lead to a serious improvement in speed and reduction in bandwidth." msgstr "" "Django 现在对使用标准的 ``ETag`` 和 ``Last-Modified`` HTTP 头部的 :doc:`条件" "视图处理 ` 提供了更好的支持。这意味着你" "现在可以通过测试成本较低的条件来轻松地中断视图处理。对于许多视图来说,这可以" "大大提高速度并减少带宽消耗。" msgid "URL namespaces" msgstr "URL 命名空间" msgid "" "Django 1.1 improves :ref:`named URL patterns ` with the " "introduction of URL \"namespaces.\"" msgstr "" "Django 1.1 引入了 URL \"命名空间\",提升了 :ref:`命名的 URL 模式 `。" msgid "" "In short, this feature allows the same group of URLs, from the same " "application, to be included in a Django URLConf multiple times, with varying " "(and potentially nested) named prefixes which will be used when performing " "reverse resolution. In other words, reusable applications like Django's " "admin interface may be registered multiple times without URL conflicts." msgstr "" "简而言之,这个功能允许相同的应用程序中的同一组 URL 在 Django 的 URLConf 中多" "次包含,使用不同(且可能嵌套)的命名前缀进行反向解析。换句话说,像 Django 的" "管理界面这样的可重用应用程序可以多次注册而不会出现 URL 冲突。" msgid "" "For full details, see :ref:`the documentation on defining URL namespaces " "`." msgstr "" "详细信息,请参阅 :ref:`关于定义 URL 命名空间的文档 `。" msgid "GeoDjango" msgstr "GeoDjango" msgid "" "In Django 1.1, :doc:`GeoDjango ` (i.e. ``django." "contrib.gis``) has several new features:" msgstr "" "在 Django 1.1 中,:doc:`GeoDjango ` (即 ``django." "contrib.gis``)引入了一些新功能:" msgid "" "Support for SpatiaLite_ -- a spatial database for SQLite -- as a spatial " "backend." msgstr "支持将 SpatiaLite_ (SQLite 的空间数据库)作为空间后端。" msgid "" "Geographic aggregates (``Collect``, ``Extent``, ``MakeLine``, ``Union``) and " "``F`` expressions." msgstr "" "地理聚合函数(``Collect``、``Extent``、``MakeLine``、``Union``)和 ``F`` 表达" "式。" msgid "" "New ``GeoQuerySet`` methods: ``collect``, ``geojson``, and ``snap_to_grid``." msgstr "" "新的 ``GeoQuerySet`` 方法:``collect``、``geojson`` 和 ``snap_to_grid``。" msgid "A new list interface methods for ``GEOSGeometry`` objects." msgstr "``GEOSGeometry`` 对象的新列表接口方法。" msgid "For more details, see the GeoDjango documentation." msgstr "要了解更多详细信息,请参阅 GeoDjango 文档。" msgid "Other improvements" msgstr "其他改进" msgid "Other new features and changes introduced since Django 1.0 include:" msgstr "自 Django 1.0 以来引入的其他新功能和更改包括:" msgid "" "The :doc:`CSRF protection middleware ` has been split into two " "classes -- ``CsrfViewMiddleware`` checks incoming requests, and " "``CsrfResponseMiddleware`` processes outgoing responses. The combined " "``CsrfMiddleware`` class (which does both) remains for backwards-" "compatibility, but using the split classes is now recommended in order to " "allow fine-grained control of when and where the CSRF processing takes place." msgstr "" ":doc:`CSRF 保护中间件 ` 现在分成了两个类 -- " "``CsrfViewMiddleware`` 用于检查传入请求,而 ``CsrfResponseMiddleware`` 用于处" "理传出响应。合并的 ``CsrfMiddleware`` 类(同时处理两者)仍然存在以保持向后兼" "容性,但现在建议使用拆分的类来允许精细控制 CSRF 处理发生的时间和地点。" msgid "" "``reverse()`` and code which uses it (e.g., the ``{% url %}`` template tag) " "now works with URLs in Django's administrative site, provided that the admin " "URLs are set up via ``include(admin.site.urls)`` (sending admin requests to " "the ``admin.site.root`` view still works, but URLs in the admin will not be " "\"reversible\" when configured this way)." msgstr "" "``reverse()`` 和使用它的代码(例如,``{% url %}`` 模板标签)现在可以在 " "Django 的管理站点中使用,前提是通过 ``include(admin.site.urls)`` 设置了管理站" "点的 URL(仍然可以通过将管理请求发送到 ``admin.site.root`` 视图来工作,但以这" "种方式配置时,管理站点中的 URL 将无法“反向生成”)。" msgid "" "The ``include()`` function in Django URLconf modules can now accept " "sequences of URL patterns (generated by ``patterns()``) in addition to " "module names." msgstr "" "Django URLconf 模块中的 ``include()`` 函数现在可以接受 URL 模式的序列(由 " "``patterns()`` 生成)以及模块名称。" msgid "" "Instances of Django forms (see :doc:`the forms overview `) now have two additional methods, ``hidden_fields()`` and " "``visible_fields()``, which return the list of hidden -- i.e., ```` -- and visible fields on the form, respectively." msgstr "" "Django 表单的实例(参见 :doc:`表单概述 `)现在具有两个额" "外的方法,``hidden_fields()`` 和 ``visible_fields()``,分别返回表单中隐藏字段" "(即 ````)和可见字段的列表。" msgid "" "The ``redirect_to`` generic view now accepts an additional keyword argument " "``permanent``. If ``permanent`` is ``True``, the view will emit an HTTP " "permanent redirect (status code 301). If ``False``, the view will emit an " "HTTP temporary redirect (status code 302)." msgstr "" "``redirect_to`` 通用视图现在接受一个额外的关键字参数 ``permanent``。如果 " "``permanent`` 为 ``True``,视图将发出 HTTP 永久重定向(状态码 301)。如果为 " "``False``,视图将发出 HTTP 临时重定向(状态码 302)。" msgid "" "A new database lookup type -- ``week_day`` -- has been added for " "``DateField`` and ``DateTimeField``. This type of lookup accepts a number " "between 1 (Sunday) and 7 (Saturday), and returns objects where the field " "value matches that day of the week. See :ref:`the full list of lookup types " "` for details." msgstr "" "已经为 ``DateField`` 和 ``DateTimeField`` 添加了一个新的数据库查找类型 -- " "``week_day``。这种查找类型接受一个介于 1(星期日)和 7(星期六)之间的数字," "并返回字段值匹配该周的对象。有关详细信息,请参阅 :ref:`查找类型的完整列表 " "`。" msgid "" "The ``{% for %}`` tag in Django's template language now accepts an optional " "``{% empty %}`` clause, to be displayed when ``{% for %}`` is asked to loop " "over an empty sequence. See :doc:`the list of built-in template tags ` for examples of this." msgstr "" "Django 模板语言中的 ``{% for %}`` 标签现在接受一个可选的 ``{% empty %}`` 子" "句,当 ``{% for %}`` 被要求循环遍历一个空序列时,可以显示该子句。有关示例,请" "参阅 :doc:`内置模板标签列表 `。" msgid "" "The :djadmin:`dumpdata` management command now accepts individual model " "names as arguments, allowing you to export the data just from particular " "models." msgstr "" ":djadmin:`dumpdata` 管理命令现在接受单个模型名称作为参数,允许你仅导出特定模" "型的数据。" msgid "" "There's a new :tfilter:`safeseq` template filter which works just like :" "tfilter:`safe` for lists, marking each item in the list as safe." msgstr "" "新增了一个 :tfilter:`safeseq` 模板过滤器,与 :tfilter:`safe` 类似,但用于列" "表,将列表中的每个项目标记为安全。" msgid "" ":doc:`Cache backends ` now support ``incr()`` and ``decr()`` " "commands to increment and decrement the value of a cache key. On cache " "backends that support atomic increment/decrement -- most notably, the " "memcached backend -- these operations will be atomic, and quite fast." msgstr "" ":doc:`缓存后端 ` 现在支持 ``incr()`` 和 ``decr()`` 命令,用于" "增加和减少缓存键的值。在支持原子增加/减少的缓存后端上,尤其是 memcached 后" "端,这些操作将是原子的,而且非常快。" msgid "" "Django now can :doc:`easily delegate authentication to the web server ` via a new authentication backend that supports the " "standard ``REMOTE_USER`` environment variable used for this purpose." msgstr "" "Django 现在可以通过一个新的身份验证后端轻松地将身份验证委托给 Web 服务器,该" "后端支持用于此目的的标准 ``REMOTE_USER`` 环境变量。请参阅 :doc:`如何将身份验" "证委托给 Web 服务器 ` 以获取详细信息。" msgid "" "There's a new :func:`django.shortcuts.redirect` function that makes it " "easier to issue redirects given an object, a view name, or a URL." msgstr "" "新增了一个 :func:`django.shortcuts.redirect` 函数,使得根据对象、视图名称或 " "URL 发出重定向变得更加容易。" msgid "" "The ``postgresql_psycopg2`` backend now supports :ref:`native PostgreSQL " "autocommit `. This is an advanced, PostgreSQL-specific " "feature, that can make certain read-heavy applications a good deal faster." msgstr "" "``postgresql_psycopg2`` 后端现在支持 :ref:`本地 PostgreSQL 自动提交 " "`。这是一个高级的、特定于 PostgreSQL 的功能,可以使某些读密" "集型应用程序变得更加快速。" msgid "What's next?" msgstr "接下来是什么?" msgid "" "We'll take a short break, and then work on Django 1.2 will begin -- no rest " "for the weary! If you'd like to help, discussion of Django development, " "including progress toward the 1.2 release, takes place daily on the |django-" "developers| mailing list and in the ``#django-dev`` IRC channel on ``irc." "libera.chat``. Feel free to join the discussions!" msgstr "" "我们会休息一下,然后开始 Django 1.2 的工作 —— 休息是为了走更远!如果你想要帮" "助,关于 Django 开发的讨论,包括朝向 1.2 版本的进展,每天都在 |django-" "developers| 邮件列表和 ``#django-dev`` IRC 频道上进行。欢迎加入讨论!" msgid "" "Django's online documentation also includes pointers on how to contribute to " "Django:" msgstr "Django 的在线文档还包括如何为 Django 做出贡献的指南:" msgid ":doc:`How to contribute to Django `" msgstr ":doc:`如何为 Django 做贡献 `" msgid "" "Contributions on any level -- developing code, writing documentation or " "simply triaging tickets and helping to test proposed bugfixes -- are always " "welcome and appreciated." msgstr "" "对于任何级别的贡献,无论是开发代码、撰写文档还是简单地对问题进行筛选并帮助测" "试提议的错误修复,我们都非常欢迎和感激。" msgid "And that's the way it is." msgstr "就是这样。" msgid "Django 1.1.2 release notes" msgstr "Django 1.1.2 版本发行说明" msgid "Welcome to Django 1.1.2!" msgstr "欢迎来到 Django 1.1.2 版本!" msgid "" "This is the second \"bugfix\" release in the Django 1.1 series, improving " "the stability and performance of the Django 1.1 codebase." msgstr "" "这是 Django 1.1 系列的第二个“错误修复”版本,改进了 Django 1.1 代码库的稳定性" "和性能。" msgid "" "Django 1.1.2 maintains backwards compatibility with Django 1.1.0, but " "contain a number of fixes and other improvements. Django 1.1.2 is a " "recommended upgrade for any development or deployment currently using or " "targeting Django 1.1." msgstr "" "Django 1.1.2 保持与 Django 1.1.0 的向后兼容性,但包含了许多修复和其他改进。对" "于当前使用或针对 Django 1.1 的任何开发或部署,建议升级到 Django 1.1.2 。" msgid "" "For full details on the new features, backwards incompatibilities, and " "deprecated features in the 1.1 branch, see the :doc:`/releases/1.1`." msgstr "" "有关 1.1 分支中新功能、向后不兼容性和已弃用功能的详细信息,请参阅 :doc:`/" "releases/1.1`。" msgid "Backwards-incompatible changes in 1.1.2" msgstr "1.1.2 中的不向后兼容的变更" msgid "Test runner exit status code" msgstr "测试运行器退出状态码" msgid "" "The exit status code of the test runners (``tests/runtests.py`` and ``python " "manage.py test``) no longer represents the number of failed tests, since a " "failure of 256 or more tests resulted in a wrong exit status code. The exit " "status code for the test runner is now 0 for success (no failing tests) and " "1 for any number of test failures. If needed, the number of test failures " "can be found at the end of the test runner's output." msgstr "" "测试运行器(``tests/runtests.py`` 和 ``python manage.py test``)的退出状态代" "码不再表示失败的测试数量,因为失败 256 个或更多测试会导致错误的退出状态代码。" "现在测试运行器的退出状态代码为 0 表示成功(没有失败的测试),为 1 表示任何数" "量的测试失败。如果需要,可以在测试运行器的输出末尾找到测试失败的数量。" msgid "Cookie encoding" msgstr "Cookie 编码" msgid "" "To fix bugs with cookies in Internet Explorer, Safari, and possibly other " "browsers, our encoding of cookie values was changed so that the characters " "comma and semi-colon are treated as non-safe characters, and are therefore " "encoded as ``\\054`` and ``\\073`` respectively. This could produce " "backwards incompatibilities, especially if you are storing comma or semi-" "colon in cookies and have JavaScript code that parses and manipulates cookie " "values client-side." msgstr "" "为了修复在 Internet Explorer、Safari 和可能其他浏览器中的 cookie 问题,我们更" "改了对 cookie 值的编码,使逗号和分号字符被视为非安全字符,因此编码为 " "``\\054`` 和 ``\\073``。这可能会产生向后不兼容性,特别是如果您在 cookie 中存" "储逗号或分号,并且有客户端 JavaScript 代码解析和操作 cookie 值。" msgid "One new feature" msgstr "一个新功能" msgid "" "Ordinarily, a point release would not include new features, but in the case " "of Django 1.1.2, we have made an exception to this rule. Django 1.2 (the " "next major release of Django) will contain a feature that will improve " "protection against Cross-Site Request Forgery (CSRF) attacks. This feature " "requires the use of a new :ttag:`csrf_token` template tag in all forms that " "Django renders." msgstr "" "通常,小版本发布不会包括新功能,但在 Django 1.1.2 中,我们对这一规则做了一个" "例外。Django 1.2(Django 的下一个主要版本)将包含一个改进跨站请求伪造(CSRF)" "攻击防护的功能。这个功能要求在 Django 渲染的所有表单中使用新的 :ttag:" "`csrf_token` 模板标签。" msgid "" "To make it easier to support both 1.1.X and 1.2.X versions of Django with " "the same templates, we have decided to introduce the :ttag:`csrf_token` " "template tag to the 1.1.X branch. In the 1.1.X branch, :ttag:`csrf_token` " "does nothing - it has no effect on templates or form processing. However, it " "means that the same template will work with Django 1.2." msgstr "" "为了更容易支持相同的模板同时运行在 1.1.X 和 1.2.X 版本的 Django 上,我们决定" "将 :ttag:`csrf_token` 模板标签引入到 1.1.X 分支。在 1.1.X 分支中,:ttag:" "`csrf_token` 没有任何作用 - 它对模板或表单处理没有影响。然而,这意味着相同的" "模板将能够在 Django 1.2 上正常工作。" msgid "Django 1.1.3 release notes" msgstr "Django 1.1.3 版本发行说明" msgid "Welcome to Django 1.1.3!" msgstr "欢迎来到 Django 1.1.3 版本!" msgid "" "This is the third \"bugfix\" release in the Django 1.1 series, improving the " "stability and performance of the Django 1.1 codebase." msgstr "" "这是 Django 1.1 系列的第三个“修复错误”版本,改进了 Django 1.1 代码库的稳定性" "和性能。" msgid "" "With one exception, Django 1.1.3 maintains backwards compatibility with " "Django 1.1.2. It also contains a number of fixes and other improvements. " "Django 1.1.2 is a recommended upgrade for any development or deployment " "currently using or targeting Django 1.1." msgstr "" "除一个例外之外,Django 1.1.3 与 Django 1.1.2 保持向后兼容。它还包含了一些修复" "和其他改进。对于当前使用或针对 Django 1.1 的任何开发或部署,Django 1.1.2 是一" "个推荐的升级版本。" msgid "Backwards incompatible changes" msgstr "不向后兼容的变更" msgid "Restricted filters in admin interface" msgstr "在管理界面中的受限过滤器" msgid "" "The Django administrative interface, ``django.contrib.admin``, supports " "filtering of displayed lists of objects by fields on the corresponding " "models, including across database-level relationships. This is implemented " "by passing lookup arguments in the querystring portion of the URL, and " "options on the ModelAdmin class allow developers to specify particular " "fields or relationships which will generate automatic links for filtering." msgstr "" "Django 的管理界面,``django.contrib.admin``,支持通过对应模型上的字段对显示的" "对象列表进行筛选,包括跨数据库级别的关系。这是通过在 URL 的查询字符串部分传递" "查找参数来实现的,ModelAdmin 类上的选项允许开发人员指定特定字段或关系,这将生" "成自动链接用于筛选。" msgid "" "One historically-undocumented and -unofficially-supported feature has been " "the ability for a user with sufficient knowledge of a model's structure and " "the format of these lookup arguments to invent useful new filters on the fly " "by manipulating the querystring." msgstr "" "一个历史上未记录且非官方支持的功能是,用户如果对模型结构和查询参数的格式有足" "够的了解,可以通过操作查询字符串来动态创建有用的新过滤器。" msgid "" "However, it has been demonstrated that this can be abused to gain access to " "information outside of an admin user's permissions; for example, an attacker " "with access to the admin and sufficient knowledge of model structure and " "relations could construct query strings which -- with repeated use of " "regular-expression lookups supported by the Django database API -- expose " "sensitive information such as users' password hashes." msgstr "" "然而,已经证明这种方法可以被滥用来获取管理员用户权限之外的信息。例如,如果攻" "击者能够访问管理员权限并且对模型结构和关联关系有足够的了解,他们可以构造查询" "字符串,通过重复使用 Django 数据库 API 支持的正则表达式查询,来获取敏感信息," "例如用户的密码哈希值。" msgid "" "To remedy this, ``django.contrib.admin`` will now validate that querystring " "lookup arguments either specify only fields on the model being viewed, or " "cross relations which have been explicitly allowed by the application " "developer using the preexisting mechanism mentioned above. This is backwards-" "incompatible for any users relying on the prior ability to insert arbitrary " "lookups." msgstr "" "为了解决这个问题,``django.contrib.admin`` 现在会验证查询字符串查找参数,要么" "只指定在正在查看的模型上的字段,要么跨关系,并且这些跨关系必须是应用程序开发" "人员使用上述现有机制明确允许的。对于依赖先前能力插入任意查找的用户来说,这是" "不兼容的。" msgid "Django 1.1.4 release notes" msgstr "Django 1.1.4 版本发行说明" msgid "Welcome to Django 1.1.4!" msgstr "欢迎来到 Django 1.1.4 版本!" msgid "" "This is the fourth \"bugfix\" release in the Django 1.1 series, improving " "the stability and performance of the Django 1.1 codebase." msgstr "" "这是 Django 1.1 系列的第四个“错误修复”版本,改进了 Django 1.1 代码库的稳定性" "和性能。" msgid "" "With one exception, Django 1.1.4 maintains backwards compatibility with " "Django 1.1.3. It also contains a number of fixes and other improvements. " "Django 1.1.4 is a recommended upgrade for any development or deployment " "currently using or targeting Django 1.1." msgstr "" "除了一个例外,Django 1.1.4 与 Django 1.1.3 兼容。它还包含了一些修复和其他改" "进。对于当前使用或目标为 Django 1.1 的任何开发或部署,推荐升级到 Django " "1.1.4 。" msgid "CSRF exception for AJAX requests" msgstr "AJAX 请求的 CSRF 例外" msgid "" "Django includes a CSRF-protection mechanism, which makes use of a token " "inserted into outgoing forms. Middleware then checks for the token's " "presence on form submission, and validates it." msgstr "" "Django 包含一个 CSRF 保护机制,它通过在传出的表单中插入一个令牌来实现。然后," "中间件在表单提交时检查令牌的存在,并对其进行验证。" msgid "" "Prior to Django 1.2.5, our CSRF protection made an exception for AJAX " "requests, on the following basis:" msgstr "" "在 Django 1.2.5 之前,我们的 CSRF 保护对 AJAX 请求做了一个例外,基于以下原" "因:" msgid "" "Many AJAX toolkits add an X-Requested-With header when using XMLHttpRequest." msgstr "" "许多 AJAX 工具包在使用 XMLHttpRequest 时会添加一个 X-Requested -With 头部。" msgid "Browsers have strict same-origin policies regarding XMLHttpRequest." msgstr "浏览器对于 XMLHttpRequest 具有严格的同源策略。" msgid "" "In the context of a browser, the only way that a custom header of this " "nature can be added is with XMLHttpRequest." msgstr "在浏览器的上下文中,只有使用 XMLHttpRequest 才能添加这种自定义头部。" msgid "" "Therefore, for ease of use, we did not apply CSRF checks to requests that " "appeared to be AJAX on the basis of the X-Requested-With header. The Ruby on " "Rails web framework had a similar exemption." msgstr "" "因此,为了方便使用,我们基于 X-Requested-With 头部,对看起来是 AJAX 请求的请" "求没有应用 CSRF 检查。 Ruby on Rails Web 框架也有类似的例外情况。" msgid "" "Recently, engineers at Google made members of the Ruby on Rails development " "team aware of a combination of browser plugins and redirects which can allow " "an attacker to provide custom HTTP headers on a request to any website. This " "can allow a forged request to appear to be an AJAX request, thereby " "defeating CSRF protection which trusts the same-origin nature of AJAX " "requests." msgstr "" "最近,Google 的工程师向 Ruby on Rails 开发团队的成员们提醒了一种结合浏览器插" "件和重定向的技术,可以允许攻击者在向任何网站发出请求时提供自定义的 HTTP 头信" "息。这可以使伪造的请求看起来像是 AJAX 请求,从而破坏了 CSRF 保护机制,因为它" "信任 AJAX 请求具有同源性质。" msgid "" "Michael Koziarski of the Rails team brought this to our attention, and we " "were able to produce a proof-of-concept demonstrating the same vulnerability " "in Django's CSRF handling." msgstr "" "Rails 团队的 Michael Koziarski 向我们提出了这个问题,我们能够制作出一个概念验" "证,证明了 Django 的 CSRF 处理也存在同样的漏洞。" msgid "" "To remedy this, Django will now apply full CSRF validation to all requests, " "regardless of apparent AJAX origin. This is technically backwards-" "incompatible, but the security risks have been judged to outweigh the " "compatibility concerns in this case." msgstr "" "为了解决这个问题,Django 现在将对所有请求应用完整的 CSRF 验证,无论它们看起来" "是否来自 AJAX 。从技术上讲,这是不兼容的,但在这种情况下,安全风险被认为超过" "了兼容性问题。" msgid "" "Additionally, Django will now accept the CSRF token in the custom HTTP " "header X-CSRFTOKEN, as well as in the form submission itself, for ease of " "use with popular JavaScript toolkits which allow insertion of custom headers " "into all AJAX requests." msgstr "" "此外,Django 现在将接受自定义 HTTP 头 X-CSRFTOKEN 中的 CSRF 令牌,以及表单提" "交本身中的令牌,以便与流行的 JavaScript 工具包一起使用,这些工具包允许在所有 " "AJAX 请求中插入自定义头。这样做是为了方便使用。" msgid "" "Please see the :ref:`CSRF docs for example jQuery code ` that " "demonstrates this technique, ensuring that you are looking at the " "documentation for your version of Django, as the exact code necessary is " "different for some older versions of Django." msgstr "" "请参阅 :ref:`CSRF 文档中的示例 jQuery 代码 `,该代码演示了这个技" "巧,确保您查看的是适用于您的 Django 版本的文档,因为一些较旧版本的 Django 需" "要不同的确切代码。" msgid "Django 1.10 release notes" msgstr "Django 1.10 版本发行说明" msgid "*August 1, 2016*" msgstr "*2016 年 8 月 1 日*" msgid "Welcome to Django 1.10!" msgstr "欢迎来到 Django 1.10 版本!" msgid "" "These release notes cover the :ref:`new features `, as well " "as some :ref:`backwards incompatible changes ` " "you'll want to be aware of when upgrading from Django 1.9 or older versions. " "We've :ref:`dropped some features ` that have reached " "the end of their deprecation cycle, and we've :ref:`begun the deprecation " "process for some features `." msgstr "" "这些发布说明涵盖了 :ref:`新功能 `,以及一些 :ref:`不兼容的更" "改 `,在从 Django 1.9 或更早版本升级时,您需要注" "意这些更改。我们已经 :ref:`放弃了一些功能 `,它们已经" "达到了停用周期的末尾,同时我们已经 :ref:`开始了一些功能的停用过程 " "`。" msgid "" "See the :doc:`/howto/upgrade-version` guide if you're updating an existing " "project." msgstr "如果你要更新现有的项目,请看 :doc:`/howto/upgrade-version` 指南。" msgid "Python compatibility" msgstr "Python 兼容性" msgid "" "Like Django 1.9, Django 1.10 requires Python 2.7, 3.4, or 3.5. We **highly " "recommend** and only officially support the latest release of each series." msgstr "" "与 Django 1.9 一样,Django 1.10 需要 Python 2.7、3.4 或 3.5。我们 **强烈建议" "** 并且只正式支持每个系列的最新版本。" msgid "What's new in Django 1.10" msgstr "Django 1.10 新特性" msgid "Full text search for PostgreSQL" msgstr "PostgreSQL 的全文搜索" msgid "" "``django.contrib.postgres`` now includes a :doc:`collection of database " "functions ` to allow the use of the full text " "search engine. You can search across multiple fields in your relational " "database, combine the searches with other lookups, use different language " "configurations and weightings, and rank the results by relevance." msgstr "" "``django.contrib.postgres`` 现在包括一个 :doc:`数据库函数集合 `,允许使用全文搜索引擎。您可以在关系数据库中跨多个字段进行搜" "索,将搜索与其他查找组合使用,使用不同的语言配置和权重,以及按相关性对结果进" "行排名。" msgid "" "It also now includes trigram support, using the :lookup:`trigram_similar` " "lookup, and the :class:`~django.contrib.postgres.search.TrigramSimilarity` " "and :class:`~django.contrib.postgres.search.TrigramDistance` expressions." msgstr "" "它还现在包括 trigram 支持,使用 :lookup:`trigram_similar` 查找以及 :class:" "`~django.contrib.postgres.search.TrigramSimilarity` 和 :class:`~django." "contrib.postgres.search.TrigramDistance` 表达式。" msgid "New-style middleware" msgstr "新式中间件" msgid "" ":doc:`A new style of middleware is introduced ` to " "solve the lack of strict request/response layering of the old-style of " "middleware described in `DEP 0005 `_. You'll need to :ref:`adapt old, " "custom middleware ` and switch from the " "``MIDDLEWARE_CLASSES`` setting to the new :setting:`MIDDLEWARE` setting to " "take advantage of the improvements." msgstr "" ":doc:`引入了一种新的中间件风格 `,以解决旧式中间件的" "请求/响应层次不严格的问题,这在 `DEP 0005 `_ 中有描述。您需要 :ref:`调整旧" "的自定义中间件 `,并从 ``MIDDLEWARE_CLASSES`` 设置切换" "到新的 :setting:`MIDDLEWARE` 设置以充分利用这些改进。" msgid "Official support for Unicode usernames" msgstr "官方支持 Unicode 用户名" msgid "" "The :class:`~django.contrib.auth.models.User` model in ``django.contrib." "auth`` originally only accepted ASCII letters and numbers in usernames. " "Although it wasn't a deliberate choice, Unicode characters have always been " "accepted when using Python 3." msgstr "" "``django.contrib.auth`` 中的 :class:`~django.contrib.auth.models.User` 模型最" "初只接受用户名中的 ASCII 字母和数字。尽管这不是一个故意的选择,在使用 Python " "3 时,Unicode 字符一直都被接受。" msgid "" "The username validator now explicitly accepts Unicode characters by default " "on Python 3 only." msgstr "用户名验证器现在默认情况下仅在 Python 3 上明确接受 Unicode 字符。" msgid "" "Custom user models may use the new :class:`~django.contrib.auth.validators." "ASCIIUsernameValidator` or :class:`~django.contrib.auth.validators." "UnicodeUsernameValidator`." msgstr "" "自定义用户模型可以使用新的 :class:`~django.contrib.auth.validators." "ASCIIUsernameValidator` 或 :class:`~django.contrib.auth.validators." "UnicodeUsernameValidator`。" msgid "Minor features" msgstr "次要特性" msgid ":mod:`django.contrib.admin`" msgstr ":mod:`django.contrib.admin`" msgid "" "For sites running on a subpath, the default :attr:`URL for the \"View site\" " "link ` at the top of each admin " "page will now point to ``request.META['SCRIPT_NAME']`` if set, instead of ``/" "``." msgstr "" "对于运行在子路径上的站点,每个管理页面顶部的默认 :attr:`\"查看站点\"链接的 " "URL ` 现在将指向 ``request." "META['SCRIPT_NAME']`` (如果设置了),而不是 ``/``。" msgid "" "The success message that appears after adding or editing an object now " "contains a link to the object's change form." msgstr "现在,在添加或编辑对象后出现的成功消息中包含到对象的更改表单的链接。" msgid "" "All inline JavaScript is removed so you can enable the ``Content-Security-" "Policy`` HTTP header if you wish." msgstr "" "所有内联 JavaScript 都已移除,因此您可以启用 ``Content-Security-Policy`` " "HTTP 标头(如果需要的话)。" msgid "" "The new :attr:`InlineModelAdmin.classes ` attribute allows specifying classes on inline " "fieldsets. Inlines with a ``collapse`` class will be initially collapsed and " "their header will have a small \"show\" link." msgstr "" "新的 :attr:`InlineModelAdmin.classes ` 属性允许在内联字段集上指定类。具有 ``collapse`` 类的内联将初始折" "叠,并且它们的标题将有一个小的 \"显示\" 链接。" msgid "" "If a user doesn't have the add permission, the ``object-tools`` block on a " "model's changelist will now be rendered (without the add button). This makes " "it easier to add custom tools in this case." msgstr "" "如果用户没有添加权限,模型的更改列表上的 ``object-tools`` 区块现在将被呈现" "(没有添加按钮)。这在这种情况下更容易添加自定义工具。" msgid "" "The :class:`~django.contrib.admin.models.LogEntry` model now stores change " "messages in a JSON structure so that the message can be dynamically " "translated using the current active language. A new ``LogEntry." "get_change_message()`` method is now the preferred way of retrieving the " "change message." msgstr "" ":class:`~django.contrib.admin.models.LogEntry` 模型现在将更改消息存储在 JSON " "结构中,以便可以使用当前活动的语言动态翻译消息。现在,首选的检索更改消息的方" "式是使用新的 ``LogEntry.get_change_message()`` 方法。" msgid "" "Selected objects for fields in ``ModelAdmin.raw_id_fields`` now have a link " "to object's change form." msgstr "" "在 ``ModelAdmin.raw_id_fields`` 中选定的字段的对象现在具有指向对象的更改表单" "的链接。" msgid "" "Added \"No date\" and \"Has date\" choices for ``DateFieldListFilter`` if " "the field is nullable." msgstr "" "如果字段可为空,为 ``DateFieldListFilter`` 添加了 \"无日期\" 和 \"有日期\" 选" "项。" msgid "" "The jQuery library embedded in the admin is upgraded from version 2.1.4 to " "2.2.3." msgstr "管理后台中嵌入的 jQuery 库已经从 2.1.4 版本升级到 2.2.3 版本。" msgid ":mod:`django.contrib.auth`" msgstr ":mod:`django.contrib.auth`" msgid "" "Added support for the :ref:`Argon2 password hash `. It's " "recommended over PBKDF2, however, it's not the default as it requires a " "third-party library." msgstr "" "增加了对 :ref:`Argon2 密码哈希 ` 的支持。它被推荐用于替代 " "PBKDF2,但不是默认选项,因为它需要一个第三方库。" msgid "" "The default iteration count for the PBKDF2 password hasher has been " "increased by 25%. This backwards compatible change will not affect users who " "have subclassed ``django.contrib.auth.hashers.PBKDF2PasswordHasher`` to " "change the default value." msgstr "" "PBKDF2 密码哈希的默认迭代次数已增加 25%。这个向后兼容的更改不会影响那些已经子" "类化了 ``django.contrib.auth.hashers.PBKDF2PasswordHasher`` 以更改默认值的用" "户。" msgid "" "The ``django.contrib.auth.views.logout()`` view sends \"no-cache\" headers " "to prevent an issue where Safari caches redirects and prevents a user from " "being able to log out." msgstr "" "``django.contrib.auth.views.logout()`` 视图发送 \"no-cache\" 标头,以防止 " "Safari 缓存重定向并阻止用户注销的问题。" msgid "" "Added the optional ``backend`` argument to :func:`django.contrib.auth.login` " "to allow using it without credentials." msgstr "" "新增了可选的 ``backend`` 参数以供 :func:`django.contrib.auth.login` 使用,允" "许在没有凭据的情况下使用它。" msgid "" "The new :setting:`LOGOUT_REDIRECT_URL` setting controls the redirect of the " "``django.contrib.auth.views.logout()`` view, if the view doesn't get a " "``next_page`` argument." msgstr "" "新的 :setting:`LOGOUT_REDIRECT_URL` 设置控制了 ``django.contrib.auth.views." "logout()`` 视图的重定向,如果视图没有得到一个 ``next_page`` 参数。" msgid "" "The new ``redirect_authenticated_user`` parameter for the ``django.contrib." "auth.views.login()`` view allows redirecting authenticated users visiting " "the login page." msgstr "" "新的 ``redirect_authenticated_user`` 参数用于 ``django.contrib.auth.views." "login()`` 视图,允许重定向已经经过身份验证的用户访问登录页面。" msgid "" "The new :class:`~django.contrib.auth.backends.AllowAllUsersModelBackend` " "and :class:`~django.contrib.auth.backends.AllowAllUsersRemoteUserBackend` " "ignore the value of ``User.is_active``, while :class:`~django.contrib.auth." "backends.ModelBackend` and :class:`~django.contrib.auth.backends." "RemoteUserBackend` now reject inactive users." msgstr "" "新的 :class:`~django.contrib.auth.backends.AllowAllUsersModelBackend` 和 :" "class:`~django.contrib.auth.backends.AllowAllUsersRemoteUserBackend` 忽略了 " "``User.is_active`` 的值,而 :class:`~django.contrib.auth.backends." "ModelBackend` 和 :class:`~django.contrib.auth.backends.RemoteUserBackend` 现" "在拒绝不活动的用户。" msgid ":mod:`django.contrib.gis`" msgstr ":mod:`django.contrib.gis`" msgid "" ":ref:`Distance lookups ` now accept expressions as the " "distance value parameter." msgstr ":ref:`距离查找 ` 现在接受表达式作为距离值参数。" msgid "" "The new :attr:`GEOSGeometry.unary_union ` property computes the union of all the elements " "of this geometry." msgstr "" "新的 :attr:`GEOSGeometry.unary_union ` 属性计算了此几何对象的所有元素的并集。" msgid "" "Added the :meth:`GEOSGeometry.covers() ` binary predicate." msgstr "" "新增了 :meth:`GEOSGeometry.covers() ` 二元谓词。" msgid "" "Added the :meth:`GDALBand.statistics() ` method and :attr:`~django.contrib.gis.gdal.GDALBand.mean` and :" "attr:`~django.contrib.gis.gdal.GDALBand.std` attributes." msgstr "" "新增了 :meth:`GDALBand.statistics() ` 方法以及 :attr:`~django.contrib.gis.gdal.GDALBand.mean` 和 :" "attr:`~django.contrib.gis.gdal.GDALBand.std` 属性。" msgid "" "Added support for the :class:`~django.contrib.gis.db.models.MakeLine` " "aggregate and :class:`~django.contrib.gis.db.models.functions.GeoHash` " "function on SpatiaLite." msgstr "" "在 SpatiaLite 上新增了对 :class:`~django.contrib.gis.db.models.MakeLine` 聚合" "和 :class:`~django.contrib.gis.db.models.functions.GeoHash` 函数的支持。" msgid "" "Added support for the :class:`~django.contrib.gis.db.models.functions." "Difference`, :class:`~django.contrib.gis.db.models.functions.Intersection`, " "and :class:`~django.contrib.gis.db.models.functions.SymDifference` functions " "on MySQL." msgstr "" "在 MySQL 上新增了对 :class:`~django.contrib.gis.db.models.functions." "Difference`、:class:`~django.contrib.gis.db.models.functions.Intersection` " "和 :class:`~django.contrib.gis.db.models.functions.SymDifference` 函数的支" "持。" msgid "Added support for instantiating empty GEOS geometries." msgstr "新增支持实例化空的 GEOS 几何对象。" msgid "" "The new :attr:`~django.contrib.gis.geos.WKTWriter.trim` and :attr:`~django." "contrib.gis.geos.WKTWriter.precision` properties of :class:`~django.contrib." "gis.geos.WKTWriter` allow controlling output of the fractional part of the " "coordinates in WKT." msgstr "" ":class:`~django.contrib.gis.geos.WKTWriter` 的新属性 :attr:`~django.contrib." "gis.geos.WKTWriter.trim` 和 :attr:`~django.contrib.gis.geos.WKTWriter." "precision` 允许控制 WKT 中坐标的小数部分的输出。" msgid "" "Added the :attr:`LineString.closed ` and :attr:`MultiLineString.closed ` properties." msgstr "" "新增了 :attr:`LineString.closed ` " "和 :attr:`MultiLineString.closed ` 属性。" msgid "" "The :doc:`GeoJSON serializer ` now outputs the " "primary key of objects in the ``properties`` dictionary if specific fields " "aren't specified." msgstr "" "如果没有指定特定字段, :doc:`GeoJSON 序列化程序 ` 现在会在 ``properties`` 字典中输出对象的主键。" msgid "" "The ability to replicate input data on the :meth:`GDALBand.data() ` method was added. Band data can now be " "updated with repeated values efficiently." msgstr "" "现在可以在 :meth:`GDALBand.data() ` 方" "法上复制输入数据。可以高效地使用重复的值更新带数据。" msgid "" "Added database functions :class:`~django.contrib.gis.db.models.functions." "IsValid` and :class:`~django.contrib.gis.db.models.functions.MakeValid`, as " "well as the :lookup:`isvalid` lookup, all for PostGIS. This allows filtering " "and repairing invalid geometries on the database side." msgstr "" "新增了数据库函数 :class:`~django.contrib.gis.db.models.functions.IsValid` " "和 :class:`~django.contrib.gis.db.models.functions.MakeValid`,以及 :lookup:" "`isvalid` 查找,都用于 PostGIS。这允许在数据库端对无效的几何对象进行过滤和修" "复。" msgid "" "Added raster support for all :doc:`spatial lookups `." msgstr "" "新增了所有 :doc:`空间查找 ` 的栅格支持。" msgid ":mod:`django.contrib.postgres`" msgstr ":mod:`django.contrib.postgres`" msgid "" "For convenience, :class:`~django.contrib.postgres.fields.HStoreField` now " "casts its keys and values to strings." msgstr "" "为了方便起见,:class:`~django.contrib.postgres.fields.HStoreField` 现在将其键" "和值转换为字符串。" msgid ":mod:`django.contrib.sessions`" msgstr ":mod:`django.contrib.sessions`" msgid "" "The :djadmin:`clearsessions` management command now removes file-based " "sessions." msgstr ":djadmin:`clearsessions` 管理命令现在会删除基于文件的会话。" msgid ":mod:`django.contrib.sites`" msgstr ":mod:`django.contrib.sites`" msgid "" "The :class:`~django.contrib.sites.models.Site` model now supports :ref:" "`natural keys `." msgstr "" ":class:`~django.contrib.sites.models.Site` 模型现在支持 :ref:`自然键 `。" msgid ":mod:`django.contrib.staticfiles`" msgstr ":mod:`django.contrib.staticfiles`" msgid "" "The :ttag:`static` template tag now uses ``django.contrib.staticfiles`` if " "it's in ``INSTALLED_APPS``. This is especially useful for third-party apps " "which can now always use ``{% load static %}`` (instead of ``{% load " "staticfiles %}`` or ``{% load static from staticfiles %}``) and not worry " "about whether or not the ``staticfiles`` app is installed." msgstr "" ":ttag:`static` 模板标签现在如果在 ``INSTALLED_APPS`` 中,将使用 ``django." "contrib.staticfiles``。这对于第三方应用程序特别有用,现在它们可以始终使用 " "``{% load static %}``(而不是 ``{% load staticfiles %}`` 或 ``{% load static " "from staticfiles %}``),并且不必担心是否安装了 ``staticfiles`` 应用程序。" msgid "" "You can :ref:`more easily customize ` " "the ``collectstatic --ignore`` option with a custom ``AppConfig``." msgstr "" "您可以通过自定义 ``AppConfig`` 更容易地 :ref:`自定义 ` ``collectstatic --ignore`` 选项。" msgid "Cache" msgstr "缓存" msgid "The file-based cache backend now uses the highest pickling protocol." msgstr "基于文件的缓存后端现在使用最高的 pickling 协议。" msgid "CSRF" msgstr "CSRF" msgid "" "The default :setting:`CSRF_FAILURE_VIEW`, ``views.csrf.csrf_failure()`` now " "accepts an optional ``template_name`` parameter, defaulting to ``'403_csrf." "html'``, to control the template used to render the page." msgstr "" "默认的 :setting:`CSRF_FAILURE_VIEW`,``views.csrf.csrf_failure()`` 现在接受一" "个可选的 ``template_name`` 参数,默认为 ``'403_csrf.html'``,用于控制渲染页面" "的模板。" msgid "" "To protect against `BREACH`_ attacks, the CSRF protection mechanism now " "changes the form token value on every request (while keeping an invariant " "secret which can be used to validate the different tokens)." msgstr "" "为了防止 `BREACH`_ 攻击,CSRF 保护机制现在会在每个请求中更改表单令牌的值(同" "时保持不变的秘密,可用于验证不同的令牌)。" msgid "Database backends" msgstr "数据库后端" msgid "Temporal data subtraction was unified on all backends." msgstr "临时数据减法在所有后端上得到了统一。" msgid "" "If the database supports it, backends can set ``DatabaseFeatures." "can_return_ids_from_bulk_insert=True`` and implement ``DatabaseOperations." "fetch_returned_insert_ids()`` to set primary keys on objects created using " "``QuerySet.bulk_create()``." msgstr "" "如果数据库支持,后端可以设置 ``DatabaseFeatures." "can_return_ids_from_bulk_insert=True`` 并实现 ``DatabaseOperations." "fetch_returned_insert_ids()``,以便在使用 ``QuerySet.bulk_create()`` 创建的对" "象上设置主键。" msgid "" "Added keyword arguments to the ``as_sql()`` methods of various expressions " "(``Func``, ``When``, ``Case``, and ``OrderBy``) to allow database backends " "to customize them without mutating ``self``, which isn't safe when using " "different database backends. See the ``arg_joiner`` and ``**extra_context`` " "parameters of :meth:`Func.as_sql() ` for an " "example." msgstr "" "为各种表达式(``Func``、``When``、``Case`` 和 ``OrderBy``)的 ``as_sql()`` 方" "法添加了关键字参数,允许数据库后端在不更改 ``self`` 的情况下自定义它们,这在" "使用不同的数据库后端时不安全。参见 :meth:`Func.as_sql() ` 的 ``arg_joiner`` 和 ``**extra_context`` 参数的示例。" msgid "File Storage" msgstr "文件存储" msgid "" "Storage backends now present a timezone-aware API with new methods :meth:" "`~django.core.files.storage.Storage.get_accessed_time`, :meth:`~django.core." "files.storage.Storage.get_created_time`, and :meth:`~django.core.files." "storage.Storage.get_modified_time`. They return a timezone-aware " "``datetime`` if :setting:`USE_TZ` is ``True`` and a naive ``datetime`` in " "the local timezone otherwise." msgstr "" "存储后端现在提供一个时区感知的 API,具有新的方法 :meth:`~django.core.files." "storage.Storage.get_accessed_time`、:meth:`~django.core.files.storage." "Storage.get_created_time` 和 :meth:`~django.core.files.storage.Storage." "get_modified_time`。如果 :setting:`USE_TZ` 为 ``True``,则它们返回一个时区感" "知的 ``datetime``,否则返回本地时区的非时区感知的 ``datetime``。" msgid "" "The new :meth:`Storage.generate_filename() ` method makes it easier to implement custom " "storages that don't use the ``os.path`` calls previously in :class:`~django." "db.models.FileField`." msgstr "" "新的 :meth:`Storage.generate_filename() ` 方法使得更容易实现不使用以前在 :class:`~django.db.models." "FileField` 中的 ``os.path`` 调用的自定义存储。" msgid "Forms" msgstr "表单" msgid "" "Form and widget ``Media`` is now served using :mod:`django.contrib." "staticfiles` if installed." msgstr "" "如果安装了 :mod:`django.contrib.staticfiles`,则现在会使用它来提供表单和小部" "件的 ``Media``。" msgid "" "The ```` tag rendered by :class:`~django.forms.CharField` now " "includes a ``minlength`` attribute if the field has a ``min_length``." msgstr "" "由 :class:`~django.forms.CharField` 渲染的 ```` 标签现在如果字段具有 " "``min_length``,则会包含一个 ``minlength`` 属性。" msgid "" "Required form fields now have the ``required`` HTML attribute. Set the new :" "attr:`Form.use_required_attribute ` attribute to ``False`` to disable it. The " "``required`` attribute isn't included on forms of formsets because the " "browser validation may not be correct when adding and deleting formsets." msgstr "" "现在,必填表单字段具有 ``required`` HTML 属性。将新的 :attr:`Form." "use_required_attribute ` 属性设置" "为 ``False`` 可以禁用它。在表单集的表单上不包括 ``required`` 属性,因为在添加" "和删除表单集时,浏览器验证可能不正确。" msgid "Generic Views" msgstr "通用视图" msgid "" "The :class:`~django.views.generic.base.View` class can now be imported from " "``django.views``." msgstr "" ":class:`~django.views.generic.base.View` 类现在可以从 ``django.views`` 中导" "入。" msgid "" "The :func:`~django.conf.urls.i18n.i18n_patterns` helper function can now be " "used in a root URLConf specified using :attr:`request.urlconf `." msgstr "" ":func:`~django.conf.urls.i18n.i18n_patterns` 辅助函数现在可以在使用 :attr:" "`request.urlconf ` 指定的根 URL 配置中使用。" msgid "" "By setting the new ``prefix_default_language`` parameter for :func:`~django." "conf.urls.i18n.i18n_patterns` to ``False``, you can allow accessing the " "default language without a URL prefix." msgstr "" "通过将 :func:`~django.conf.urls.i18n.i18n_patterns` 的新参数 " "``prefix_default_language`` 设置为 ``False``,您可以允许在没有 URL 前缀的情况" "下访问默认语言。" msgid "" ":func:`~django.views.i18n.set_language` now returns a 204 status code (No " "Content) for AJAX requests when there is no ``next`` parameter in ``POST`` " "or ``GET``." msgstr "" "现在,当在 ``POST`` 或 ``GET`` 中没有 ``next`` 参数时,:func:`~django.views." "i18n.set_language` 对于 AJAX 请求会返回 204 状态码(No Content)。" msgid "" "The :class:`~django.views.i18n.JavaScriptCatalog` and :class:`~django.views." "i18n.JSONCatalog` class-based views supersede the deprecated " "``javascript_catalog()`` and ``json_catalog()`` function-based views. The " "new views are almost equivalent to the old ones except that by default the " "new views collect all JavaScript strings in the ``djangojs`` translation " "domain from all installed apps rather than only the JavaScript strings from :" "setting:`LOCALE_PATHS`." msgstr "" ":class:`~django.views.i18n.JavaScriptCatalog` 和 :class:`~django.views.i18n." "JSONCatalog` 类视图取代了不推荐使用的 ``javascript_catalog()`` 和 " "``json_catalog()`` 函数视图。新视图与旧视图几乎相同,唯一的区别是,默认情况" "下,新视图会从所有已安装的应用程序中收集 ``djangojs`` 翻译域中的所有 " "JavaScript 字符串,而不仅仅是来自 :setting:`LOCALE_PATHS` 的 JavaScript 字符" "串。" msgid "Management Commands" msgstr "管理命令" msgid "" ":func:`~django.core.management.call_command` now returns the value returned " "from the ``command.handle()`` method." msgstr "" "现在,:func:`~django.core.management.call_command` 会返回从 ``command." "handle()`` 方法返回的值。" msgid "" "The new :option:`check --fail-level` option allows specifying the message " "level that will cause the command to exit with a non-zero status." msgstr "" "新的 :option:`check --fail-level` 选项允许指定消息级别,该级别将导致命令以非" "零状态退出。" msgid "" "The new :option:`makemigrations --check` option makes the command exit with " "a non-zero status when model changes without migrations are detected." msgstr "" "新的 :option:`makemigrations --check` 选项在检测到模型更改而没有迁移时,使命" "令以非零状态退出。" msgid "" ":djadmin:`makemigrations` now displays the path to the migration files that " "it generates." msgstr ":djadmin:`makemigrations` 现在会显示生成的迁移文件的路径。" msgid "" "The :option:`shell --interface` option now accepts ``python`` to force use " "of the \"plain\" Python interpreter." msgstr "" ":option:`shell --interface` 选项现在接受 ``python``,以强制使用 \"plain\" " "Python 解释器。" msgid "" "The new :option:`shell --command` option lets you run a command as Django " "and exit, instead of opening the interactive shell." msgstr "" "新的 :option:`shell --command` 选项允许您以 Django 用户身份运行命令并退出,而" "不是打开交互式 shell。" msgid "" "Added a warning to :djadmin:`dumpdata` if a proxy model is specified (which " "results in no output) without its concrete parent." msgstr "" "如果指定了代理模型(导致没有输出)而没有指定其具体的父模型,:djadmin:" "`dumpdata` 现在会显示警告。" msgid "" "The new :attr:`BaseCommand.requires_migrations_checks ` attribute may be set to " "``True`` if you want your command to print a warning, like :djadmin:" "`runserver` does, if the set of migrations on disk don't match the " "migrations in the database." msgstr "" "新的 :attr:`BaseCommand.requires_migrations_checks ` 属性可以设置为 ``True``,如果您希望" "您的命令在磁盘上的迁移集与数据库中的迁移不匹配时打印警告,就像 :djadmin:" "`runserver` 一样。" msgid "" "To assist with testing, :func:`~django.core.management.call_command` now " "accepts a command object as the first argument." msgstr "" "为了辅助测试,:func:`~django.core.management.call_command` 现在接受一个命令对" "象作为第一个参数。" msgid "" "The :djadmin:`shell` command supports tab completion on systems using " "``libedit``, e.g. macOS." msgstr "" ":djadmin:`shell` 命令在使用 ``libedit`` 的系统上支持制表符自动完成,例如 " "macOS。" msgid "" "The :djadmin:`inspectdb` command lets you choose what tables should be " "inspected by specifying their names as arguments." msgstr "" ":djadmin:`inspectdb` 命令允许您通过将表的名称指定为参数来选择应该进行检查的" "表。" msgid "Migrations" msgstr "迁移" msgid "Added support for serialization of ``enum.Enum`` objects." msgstr "新增支持序列化 ``enum.Enum`` 对象。" msgid "" "Added the ``elidable`` argument to the :class:`~django.db.migrations." "operations.RunSQL` and :class:`~django.db.migrations.operations.RunPython` " "operations to allow them to be removed when squashing migrations." msgstr "" "在 :class:`~django.db.migrations.operations.RunSQL` 和 :class:`~django.db." "migrations.operations.RunPython` 操作中添加了 ``elidable`` 参数,以允许在压缩" "迁移时删除它们。" msgid "" "Added support for :ref:`non-atomic migrations ` by " "setting the ``atomic`` attribute on a ``Migration``." msgstr "" "通过在 ``Migration`` 上设置 ``atomic`` 属性,添加了对 :ref:`非原子迁移 ` 的支持。" msgid "" "The ``migrate`` and ``makemigrations`` commands now :ref:`check for a " "consistent migration history `. If they find " "some unapplied dependencies of an applied migration, " "``InconsistentMigrationHistory`` is raised." msgstr "" "``migrate`` 和 ``makemigrations`` 命令现在会 :ref:`检查一致的迁移历史 " "`。如果它们发现某些已应用的迁移存在未应用的依" "赖项,将会引发 ``InconsistentMigrationHistory`` 异常。" msgid "" "The :func:`~django.db.models.signals.pre_migrate` and :func:`~django.db." "models.signals.post_migrate` signals now dispatch their migration ``plan`` " "and ``apps``." msgstr "" ":func:`~django.db.models.signals.pre_migrate` 和 :func:`~django.db.models." "signals.post_migrate` 信号现在会分发它们的迁移 ``plan`` 和 ``apps``。" msgid "" "Reverse foreign keys from proxy models are now propagated to their concrete " "class. The reverse relation attached by a :class:`~django.db.models." "ForeignKey` pointing to a proxy model is now accessible as a descriptor on " "the proxied model class and may be referenced in queryset filtering." msgstr "" "来自代理模型的反向外键现在会传播到它们的具体类。指向代理模型的 :class:" "`~django.db.models.ForeignKey` 所附加的反向关系现在可以作为描述符在代理模型类" "上访问,并且可以在查询集过滤中引用。" msgid "" "The new :meth:`Field.rel_db_type() ` " "method returns the database column data type for fields such as " "``ForeignKey`` and ``OneToOneField`` that point to another field." msgstr "" "新的 :meth:`Field.rel_db_type() ` 方法返" "回了诸如 ``ForeignKey`` 和 ``OneToOneField`` 这样指向另一个字段的字段的数据库" "列数据类型。" msgid "" "The :attr:`~django.db.models.Func.arity` class attribute is added to :class:" "`~django.db.models.Func`. This attribute can be used to set the number of " "arguments the function accepts." msgstr "" ":class:`~django.db.models.Func` 添加了 :attr:`~django.db.models.Func.arity` " "类属性。此属性可用于设置函数接受的参数数量。" msgid "" "Added :class:`~django.db.models.BigAutoField` which acts much like an :class:" "`~django.db.models.AutoField` except that it is guaranteed to fit numbers " "from ``1`` to ``9223372036854775807``." msgstr "" "新增了 :class:`~django.db.models.BigAutoField`,它的行为类似于 :class:" "`~django.db.models.AutoField`,但它保证适合于范围从 ``1`` 到 " "``9223372036854775807`` 的数字。" msgid "" ":meth:`QuerySet.in_bulk() ` may be " "called without any arguments to return all objects in the queryset." msgstr "" "可以不带任何参数调用 :meth:`QuerySet.in_bulk() `,以返回查询集中的所有对象。" msgid "" ":attr:`~django.db.models.ForeignKey.related_query_name` now supports app " "label and class interpolation using the ``'%(app_label)s'`` and " "``'%(class)s'`` strings." msgstr "" ":attr:`~django.db.models.ForeignKey.related_query_name` 现在支持使用 " "``'%(app_label)s'`` 和 ``'%(class)s'`` 字符串进行应用标签和类的插值。" msgid "Allowed overriding model fields inherited from abstract base classes." msgstr "允许覆盖从抽象基类继承的模型字段。" msgid "" "The :func:`~django.db.models.prefetch_related_objects` function is now a " "public API." msgstr "" ":func:`~django.db.models.prefetch_related_objects` 函数现在是一个公共 API。" msgid "" ":meth:`QuerySet.bulk_create() ` " "sets the primary key on objects when using PostgreSQL." msgstr "" ":meth:`QuerySet.bulk_create() ` " "在使用 PostgreSQL 时会设置对象的主键。" msgid "Added the :class:`~django.db.models.functions.Cast` database function." msgstr "新增了 :class:`~django.db.models.functions.Cast` 数据库函数。" msgid "" "A proxy model may now inherit multiple proxy models that share a common non-" "abstract parent class." msgstr "现在,代理模型可以继承多个共享非抽象父类的代理模型。" msgid "" "Added :class:`~django.db.models.functions.Extract` functions to extract " "datetime components as integers, such as year and hour." msgstr "" "新增了 :class:`~django.db.models.functions.Extract` 函数,用于提取日期时间组" "件作为整数,例如年份和小时。" msgid "" "Added :class:`~django.db.models.functions.Trunc` functions to truncate a " "date or datetime to a significant component. They enable queries like sales-" "per-day or sales-per-hour." msgstr "" "新增了 :class:`~django.db.models.functions.Trunc` 函数,用于将日期或日期时间" "截断到一个重要的组件。它们使得可以执行类似每天销售或每小时销售的查询。" msgid "" "``Model.__init__()`` now sets values of virtual fields from its keyword " "arguments." msgstr "``Model.__init__()`` 现在会从关键字参数中设置虚拟字段的值。" msgid "" "The new :attr:`Meta.base_manager_name ` and :attr:`Meta.default_manager_name ` options allow controlling the :attr:`~django." "db.models.Model._base_manager` and :attr:`~django.db.models.Model." "_default_manager`, respectively." msgstr "" "新的 :attr:`Meta.base_manager_name ` 和 :attr:`Meta.default_manager_name ` 选项允许分别控制 :attr:`~django.db.models." "Model._base_manager` 和 :attr:`~django.db.models.Model._default_manager`。" msgid "Requests and Responses" msgstr "请求和响应" msgid "Added ``request.user`` to the debug view." msgstr "在调试视图中添加了 ``request.user``。" msgid "" "Added :class:`~django.http.HttpResponse` methods :meth:`~django.http." "HttpResponse.readable()` and :meth:`~django.http.HttpResponse.seekable()` to " "make an instance a stream-like object and allow wrapping it with :py:class:" "`io.TextIOWrapper`." msgstr "" "添加了 :class:`~django.http.HttpResponse` 的方法 :meth:`~django.http." "HttpResponse.readable()` 和 :meth:`~django.http.HttpResponse.seekable()`,以" "使实例成为类似流的对象,并允许将其包装在 :py:class:`io.TextIOWrapper` 中。" msgid "" "Added the :attr:`HttpRequest.content_type ` and :attr:`~django.http.HttpRequest.content_params` " "attributes which are parsed from the ``CONTENT_TYPE`` header." msgstr "" "添加了 :attr:`HttpRequest.content_type ` 和 :attr:`~django.http.HttpRequest.content_params` 属性,这些" "属性从 ``CONTENT_TYPE`` 标头中解析而来。" msgid "" "The parser for ``request.COOKIES`` is simplified to better match the " "behavior of browsers. ``request.COOKIES`` may now contain cookies that are " "invalid according to :rfc:`6265` but are possible to set via ``document." "cookie``." msgstr "" "``request.COOKIES`` 的解析器被简化,以更好地匹配浏览器的行为。``request." "COOKIES`` 现在可以包含根据 :rfc:`6265` 无效但可以通过 ``document.cookie`` 设" "置的 cookie。" msgid "Serialization" msgstr "序列化" msgid "" "The ``django.core.serializers.json.DjangoJSONEncoder`` now knows how to " "serialize lazy strings, typically used for translatable content." msgstr "" "``django.core.serializers.json.DjangoJSONEncoder`` 现在知道如何序列化懒惰字符" "串,通常用于可翻译的内容。" msgid "" "Added the ``autoescape`` option to the :class:`~django.template.backends." "django.DjangoTemplates` backend and the :class:`~django.template.Engine` " "class." msgstr "" "在 :class:`~django.template.backends.django.DjangoTemplates` 后端和 :class:" "`~django.template.Engine` 类中添加了 ``autoescape`` 选项。" msgid "" "Added the ``is`` and ``is not`` comparison operators to the :ttag:`if` tag." msgstr "在 :ttag:`if` 标签中添加了 ``is`` 和 ``is not`` 比较运算符。" msgid "" "Allowed :tfilter:`dictsort` to order a list of lists by an element at a " "specified index." msgstr "" "允许使用 :tfilter:`dictsort` 根据指定索引处的元素对列表中的列表进行排序。" msgid "" "The :func:`~django.template.context_processors.debug` context processor " "contains queries for all database aliases instead of only the default alias." msgstr "" ":func:`~django.template.context_processors.debug` 上下文处理器包含了所有数据" "库别名的查询,而不仅仅是默认别名。" msgid "" "Added relative path support for string arguments of the :ttag:`extends` and :" "ttag:`include` template tags." msgstr "" "对 :ttag:`extends` 和 :ttag:`include` 模板标签的字符串参数添加了相对路径支" "持。" msgid "Tests" msgstr "测试" msgid "" "To better catch bugs, :class:`~django.test.TestCase` now checks deferrable " "database constraints at the end of each test." msgstr "" "为了更好地捕获错误,:class:`~django.test.TestCase` 现在在每个测试结束时检查可" "延迟的数据库约束。" msgid "" "Tests and test cases can be :ref:`marked with tags ` " "and run selectively with the new :option:`test --tag` and :option:`test --" "exclude-tag` options." msgstr "" "测试和测试用例可以被 :ref:`标记为标签 ` 并可以使用新" "的 :option:`test --tag` 和 :option:`test --exclude-tag` 选项进行选择性运行。" msgid "" "You can now login and use sessions with the test client even if :mod:`django." "contrib.sessions` is not in :setting:`INSTALLED_APPS`." msgstr "" "即使 :mod:`django.contrib.sessions` 不在 :setting:`INSTALLED_APPS` 中,您现在" "也可以使用测试客户端登录并使用会话。" msgid "" "An addition in :func:`django.setup()` allows URL resolving that happens " "outside of the request/response cycle (e.g. in management commands and " "standalone scripts) to take :setting:`FORCE_SCRIPT_NAME` into account when " "it is set." msgstr "" "在 :func:`django.setup()` 中的一个新添加允许在请求/响应周期之外发生的 URL 解" "析(例如在管理命令和独立脚本中)在设置 :setting:`FORCE_SCRIPT_NAME` 时考虑到" "它。" msgid "Validators" msgstr "验证器" msgid "" ":class:`~django.core.validators.URLValidator` now limits the length of " "domain name labels to 63 characters and the total length of domain names to " "253 characters per :rfc:`1034`." msgstr "" ":class:`~django.core.validators.URLValidator` 现在将域名标签的长度限制为 63 " "个字符,域名的总长度限制为 253 个字符,符合 :rfc:`1034` 的规定。" msgid "" ":func:`~django.core.validators.int_list_validator` now accepts an optional " "``allow_negative`` boolean parameter, defaulting to ``False``, to allow " "negative integers." msgstr "" ":func:`~django.core.validators.int_list_validator` 现在接受一个可选的布尔参" "数 ``allow_negative``,默认为 ``False``,以允许负整数。" msgid "Backwards incompatible changes in 1.10" msgstr "1.10 中的不向后兼容的变更" msgid "" "In addition to the changes outlined in this section, be sure to review the :" "ref:`removed-features-1.10` for the features that have reached the end of " "their deprecation cycle and therefore been removed. If you haven't updated " "your code within the deprecation timeline for a given feature, its removal " "may appear as a backwards incompatible change." msgstr "" "除了本节中概述的更改之外,请务必查看 :ref:`removed-features-1.10`,了解已经到" "达了弃用周期终点并因此被移除的功能。如果您没有在给定功能的弃用时间表内更新您" "的代码,它的移除可能会被视为不兼容的更改。" msgid "Database backend API" msgstr "数据库后端 API" msgid "" "GIS's ``AreaField`` uses an unspecified underlying numeric type that could " "in practice be any numeric Python type. ``decimal.Decimal`` values retrieved " "from the database are now converted to ``float`` to make it easier to " "combine them with values used by the GIS libraries." msgstr "" "GIS 的 ``AreaField`` 使用一个未指定的底层数字类型,实际上可以是任何 Python 数" "值类型。从数据库中检索到的 ``decimal.Decimal`` 值现在被转换为 ``float``,以便" "更容易将它们与 GIS 库使用的值结合在一起。" msgid "" "In order to enable temporal subtraction you must set the " "``supports_temporal_subtraction`` database feature flag to ``True`` and " "implement the ``DatabaseOperations.subtract_temporals()`` method. This " "method should return the SQL and parameters required to compute the " "difference in microseconds between the ``lhs`` and ``rhs`` arguments in the " "datatype used to store :class:`~django.db.models.DurationField`." msgstr "" "为了启用时间减法,您必须将数据库功能标志 ``supports_temporal_subtraction`` 设" "置为 ``True``,并实现 ``DatabaseOperations.subtract_temporals()`` 方法。该方" "法应返回计算``lhs`` 和 ``rhs`` 参数之间差异的微秒数所需的 SQL 和参数,其数据" "类型用于存储 :class:`~django.db.models.DurationField`。" msgid "" "``select_related()`` prohibits non-relational fields for nested relations" msgstr "``select_related()`` 禁止嵌套关系的非关系字段。" msgid "" "Django 1.8 added validation for non-relational fields in " "``select_related()``:" msgstr "Django 1.8 添加了 ``select_related()`` 中非关系字段的验证:" msgid "But it didn't prohibit nested non-relation fields as it does now:" msgstr "但是现在它禁止了嵌套的非关系字段,而之前没有禁止。" msgid "" "``_meta.get_fields()`` returns consistent reverse fields for proxy models" msgstr "``_meta.get_fields()`` 为代理模型返回一致的反向字段。" msgid "" "Before Django 1.10, the :meth:`~django.db.models.options.Options.get_fields` " "method returned different reverse fields when called on a proxy model " "compared to its proxied concrete class. This inconsistency was fixed by " "returning the full set of fields pointing to a concrete class or one of its " "proxies in both cases." msgstr "" "在 Django 1.10 之前,当在代理模型上调用 :meth:`~django.db.models.options." "Options.get_fields` 方法时,返回的反向字段与其代理的具体类相比是不同的。这种" "不一致性已经通过在两种情况下都返回指向具体类或其代理之一的字段的完整集合来修" "复。" msgid "" ":attr:`AbstractUser.username ` " "``max_length`` increased to 150" msgstr "" ":attr:`AbstractUser.username ` 的 " "``max_length`` 增加到了 150。" msgid "" "A migration for :attr:`django.contrib.auth.models.User.username` is " "included. If you have a custom user model inheriting from ``AbstractUser``, " "you'll need to generate and apply a database migration for your user model." msgstr "" "包括了一个针对 :attr:`django.contrib.auth.models.User.username` 的迁移。如果" "您有一个继承自 ``AbstractUser`` 的自定义用户模型,您需要为您的用户模型生成并" "应用一个数据库迁移。" msgid "" "We considered an increase to 254 characters to more easily allow the use of " "email addresses (which are limited to 254 characters) as usernames but " "rejected it due to a MySQL limitation. When using the ``utf8mb4`` encoding " "(recommended for proper Unicode support), MySQL can only create unique " "indexes with 191 characters by default. Therefore, if you need a longer " "length, please use a custom user model." msgstr "" "我们考虑将用户名的最大长度增加到 254 个字符,以更容易允许使用电子邮件地址(限" "制为 254 个字符)作为用户名,但由于 MySQL 的限制而拒绝了这个提案。当使用 " "``utf8mb4`` 编码(推荐用于正确支持 Unicode)时,默认情况下,MySQL 只能创建包" "含 191 个字符的唯一索引。因此,如果您需要更长的长度,请使用自定义用户模型。" msgid "" "If you want to preserve the 30 character limit for usernames, use a custom " "form when creating a user or changing usernames::" msgstr "" "如果您想保留用户名的 30 个字符限制,请在创建用户或更改用户名时使用自定义表" "单:" msgid "" "If you wish to keep this restriction in the admin, set ``UserAdmin." "add_form`` to use this form::" msgstr "" "如果您希望在管理员中保留这个限制,可以将 ``UserAdmin.add_form`` 设置为使用以" "下表单:" msgid "Dropped support for PostgreSQL 9.1" msgstr "停止支持 PostgreSQL 9.1" msgid "" "Upstream support for PostgreSQL 9.1 ends in September 2016. As a " "consequence, Django 1.10 sets PostgreSQL 9.2 as the minimum version it " "officially supports." msgstr "" "PostgreSQL 9.1 的上游支持将在 2016 年 9 月结束。因此,Django 1.10 将 " "PostgreSQL 9.2 设置为其正式支持的最低版本。" msgid "``runserver`` output goes through logging" msgstr "``runserver`` 输出经过日志记录" msgid "" "Request and response handling of the ``runserver`` command is sent to the :" "ref:`django-server-logger` logger instead of to ``sys.stderr``. If you " "disable Django's logging configuration or override it with your own, you'll " "need to add the appropriate logging configuration if you want to see that " "output::" msgstr "" "``runserver`` 命令的请求和响应处理发送到 :ref:`django-server-logger` 日志记录" "器,而不是发送到 ``sys.stderr``。如果您禁用了 Django 的日志配置或使用自己的配" "置覆盖了它,如果您想看到该输出,您需要添加适当的日志配置:" msgid "``auth.CustomUser`` and ``auth.ExtensionUser`` test models were removed" msgstr "``auth.CustomUser`` 和 ``auth.ExtensionUser`` 测试模型已被移除。" msgid "" "Since the introduction of migrations for the contrib apps in Django 1.8, the " "tables of these custom user test models were not created anymore making them " "unusable in a testing context." msgstr "" "自 Django 1.8 开始为 contrib 应用程序引入迁移以来,这些自定义用户测试模型的表" "不再创建,使它们无法在测试环境中使用。" msgid "" "Apps registry is no longer auto-populated when unpickling models outside of " "Django" msgstr "在 Django 之外反序列化模型时,应用程序注册表不再自动填充。" msgid "" "The apps registry is no longer auto-populated when unpickling models. This " "was added in Django 1.7.2 as an attempt to allow unpickling models outside " "of Django, such as in an RQ worker, without calling ``django.setup()``, but " "it creates the possibility of a deadlock. To adapt your code in the case of " "RQ, you can `provide your own worker script `_ that calls ``django.setup()``." msgstr "" "在反序列化模型时,不再自动填充应用程序注册表。这在 Django 1.7.2 中添加,是为" "了允许在 Django 之外反序列化模型,比如在 RQ worker 中,而不需要调用 ``django." "setup()``,但这会导致死锁的可能性。在 RQ 的情况下,为了适应您的代码,您可以 `" "提供自己的工作脚本 `_,其中调用 " "``django.setup()``。" msgid "Removed null assignment check for non-null foreign key fields" msgstr "删除了非空外键字段的空值赋值检查。" msgid "" "In older versions, assigning ``None`` to a non-nullable ``ForeignKey`` or " "``OneToOneField`` raised ``ValueError('Cannot assign None: \"model.field\" " "does not allow null values.')``. For consistency with other model fields " "which don't have a similar check, this check is removed." msgstr "" "在旧版本中,将 ``None`` 分配给非空 ``ForeignKey`` 或 ``OneToOneField`` 会引" "发 ``ValueError('Cannot assign None: \"model.field\" does not allow null " "values.')``。为了与没有类似检查的其他模型字段保持一致,此检查已被移除。" msgid "" "Removed weak password hashers from the default ``PASSWORD_HASHERS`` setting" msgstr "从默认的 ``PASSWORD_HASHERS`` 设置中移除了弱密码哈希器。" msgid "" "Django 0.90 stored passwords as unsalted MD5. Django 0.91 added support for " "salted SHA1 with automatic upgrade of passwords when a user logs in. Django " "1.4 added PBKDF2 as the default password hasher." msgstr "" "Django 0.90 将密码存储为未加盐的 MD5 。 Django 0.91 添加了对加盐 SHA1 的支" "持,并在用户登录时自动升级密码。 Django 1.4 将 PBKDF2 作为默认密码哈希器。" msgid "" "If you have an old Django project with MD5 or SHA1 (even salted) encoded " "passwords, be aware that these can be cracked fairly easily with today's " "hardware. To make Django users acknowledge continued use of weak hashers, " "the following hashers are removed from the default :setting:" "`PASSWORD_HASHERS` setting::" msgstr "" "如果您有一个旧的 Django 项目,其中包含使用 MD5 或 SHA1(即使使用了盐值)编码" "的密码,请注意,这些密码可以在今天的硬件上相对容易地被破解。为了让 Django 用" "户确认继续使用弱哈希器,以下哈希器已从默认的 :setting:`PASSWORD_HASHERS` 设置" "中移除:" msgid "" "Consider using a :ref:`wrapped password hasher ` " "to strengthen the hashes in your database. If that's not feasible, add the :" "setting:`PASSWORD_HASHERS` setting to your project and add back any hashers " "that you need." msgstr "" "考虑使用一个 :ref:`包装的密码哈希器 ` 来加强数据库" "中的哈希值。如果这不可行,可以将 :setting:`PASSWORD_HASHERS` 设置添加到您的项" "目中,并添加回您需要的任何哈希器。" msgid "" "You can check if your database has any of the removed hashers like this::" msgstr "您可以像这样检查您的数据库是否具有任何已删除的哈希器:" msgid "" "``Field.get_prep_lookup()`` and ``Field.get_db_prep_lookup()`` methods are " "removed" msgstr "" "``Field.get_prep_lookup()`` 和 ``Field.get_db_prep_lookup()`` 方法已被移除。" msgid "" "If you have a custom field that implements either of these methods, register " "a custom lookup for it. For example::" msgstr "" "如果您有一个自定义字段实现了这两种方法中的任何一种,请为其注册一个自定义查" "找。例如:" msgid "Support for SpatiaLite < 3.0 and GEOS < 3.3 is dropped." msgstr "不再支持 SpatiaLite < 3.0 和 GEOS < 3.3 。" msgid "" "The ``add_postgis_srs()`` backwards compatibility alias for ``django.contrib." "gis.utils.add_srs_entry()`` is removed." msgstr "" "``add_postgis_srs()`` 的向后兼容别名已被移除,应使用 ``django.contrib.gis." "utils.add_srs_entry()``。" msgid "" "On Oracle/GIS, the :class:`~django.contrib.gis.db.models.functions.Area` " "aggregate function now returns a ``float`` instead of ``decimal.Decimal``. " "(It's still wrapped in a measure of square meters.)" msgstr "" "在 Oracle/GIS 上,:class:`~django.contrib.gis.db.models.functions.Area` 聚合" "函数现在返回一个 ``float``,而不再是 ``decimal.Decimal``。(它仍然以平方米为" "单位包装。)" msgid "" "The default :class:`~django.contrib.gis.geos.GEOSGeometry` representation " "(WKT output) is trimmed by default. That is, instead of ``POINT " "(23.0000000000000000 5.5000000000000000)``, you'll get ``POINT (23 5.5)``." msgstr "" "默认情况下,:class:`~django.contrib.gis.geos.GEOSGeometry` 的表示形式(WKT 输" "出)现在默认被修剪。也就是说,不再是 ``POINT (23.0000000000000000 " "5.5000000000000000)``,而是 ``POINT (23 5.5)``。" msgid "" "Maximum size of a request body and the number of GET/POST parameters is " "limited" msgstr "请求体的最大大小以及 GET/POST 参数的数量受到限制。" msgid "" "Two new settings help mitigate denial-of-service attacks via large requests:" msgstr "两个新配置有助于减轻通过大型请求发起的拒绝服务攻击:" msgid "" ":setting:`DATA_UPLOAD_MAX_MEMORY_SIZE` limits the size that a request body " "may be. File uploads don't count toward this limit." msgstr "" ":setting:`DATA_UPLOAD_MAX_MEMORY_SIZE` 限制请求主体的大小。文件上传不计入此限" "制。" msgid "" ":setting:`DATA_UPLOAD_MAX_NUMBER_FIELDS` limits the number of GET/POST " "parameters that are parsed." msgstr "" ":setting:`DATA_UPLOAD_MAX_NUMBER_FIELDS` 限制解析的 GET/POST 参数的数量。" msgid "" "Applications that receive unusually large form posts may need to tune these " "settings." msgstr "接收异常大表单提交的应用程序可能需要调整这些设置。" msgid "Miscellaneous" msgstr "杂项" msgid "" "The ``repr()`` of a ``QuerySet`` is wrapped in ```` to " "disambiguate it from a plain list when debugging." msgstr "" "``QuerySet`` 的 ``repr()`` 现在在调试时会包装在 ```` 中,以便与普" "通列表进行区分。" msgid "" "``utils.version.get_version()`` returns :pep:`440` compliant release " "candidate versions (e.g. '1.10rc1' instead of '1.10c1')." msgstr "" "``utils.version.get_version()`` 返回符合 :pep:`440` 的候选版本(例如 " "'1.10rc1' 而不是 '1.10c1')。" msgid "" "CSRF token values are now required to be strings of 64 alphanumerics; values " "of 32 alphanumerics, as set by older versions of Django by default, are " "automatically replaced by strings of 64 characters. Other values are " "considered invalid. This should only affect developers or users who replace " "these tokens." msgstr "" "现在要求 CSRF 令牌值必须是 64 个字母数字字符串;默认情况下,由旧版 Django 设" "置的 32 个字母数字值将自动替换为 64 个字符的字符串。其他值将被视为无效。这应" "该只会影响替换这些令牌的开发人员或用户。" msgid "" "The ``LOGOUT_URL`` setting is removed as Django hasn't made use of it since " "pre-1.0. If you use it in your project, you can add it to your project's " "settings. The default value was ``'/accounts/logout/'``." msgstr "" "``LOGOUT_URL`` 设置已删除,因为自 1.0 版本以来 Django 不再使用它。如果你在项" "目中使用了它,可以将其添加到项目的设置中。默认值是 ``'/accounts/logout/'``。" msgid "" "Objects with a ``close()`` method such as files and generators passed to :" "class:`~django.http.HttpResponse` are now closed immediately instead of when " "the WSGI server calls ``close()`` on the response." msgstr "" "具有 ``close()`` 方法的对象,例如文件和生成器,传递给 :class:`~django.http." "HttpResponse` 现在会立即关闭,而不是在 WSGI 服务器调用响应的 ``close()`` 方法" "时关闭。" msgid "" "A redundant ``transaction.atomic()`` call in ``QuerySet.update_or_create()`` " "is removed. This may affect query counts tested by ``TransactionTestCase." "assertNumQueries()``." msgstr "" "在 ``QuerySet.update_or_create()`` 中删除了多余的 ``transaction.atomic()`` 调" "用。这可能会影响 ``TransactionTestCase.assertNumQueries()`` 测试的查询计数。" msgid "" "Support for ``skip_validation`` in ``BaseCommand.execute(**options)`` is " "removed. Use ``skip_checks`` (added in Django 1.7) instead." msgstr "" "在 ``BaseCommand.execute(**options)`` 中删除了对 ``skip_validation`` 的支持。" "请改用 ``skip_checks`` (Django 1.7 中添加)来代替。" msgid "" ":djadmin:`loaddata` now raises a ``CommandError`` instead of showing a " "warning when the specified fixture file is not found." msgstr "" "现在,在指定的夹具文件未找到时,:djadmin:`loaddata` 将引发一个 " "``CommandError``,而不是显示警告。" msgid "" "Instead of directly accessing the ``LogEntry.change_message`` attribute, " "it's now better to call the ``LogEntry.get_change_message()`` method which " "will provide the message in the current language." msgstr "" "现在,最好调用 ``LogEntry.get_change_message()`` 方法来获取日志条目的消息,而" "不是直接访问 ``LogEntry.change_message`` 属性,这样可以提供当前语言的消息。" msgid "" "The default error views now raise ``TemplateDoesNotExist`` if a nonexistent " "``template_name`` is specified." msgstr "" "如果指定了不存在的 ``template_name``,默认错误视图现在会引发 " "``TemplateDoesNotExist`` 异常。" msgid "" "The unused ``choices`` keyword argument of the ``Select`` and " "``SelectMultiple`` widgets' ``render()`` method is removed. The ``choices`` " "argument of the ``render_options()`` method is also removed, making " "``selected_choices`` the first argument." msgstr "" "``Select`` 和 ``SelectMultiple`` 小部件的 ``render()`` 方法中未使用的 " "``choices`` 关键字参数已被移除。 ``render_options()`` 方法中的 ``choices`` 参" "数也已被移除,现在 ``selected_choices`` 是第一个参数。" msgid "" "Tests that violate deferrable database constraints will now error when run " "on a database that supports deferrable constraints." msgstr "" "现在,在支持可延迟约束的数据库上运行的违反可延迟数据库约束的测试将会出现错" "误。" msgid "" "Built-in management commands now use indexing of keys in ``options``, e.g. " "``options['verbosity']``, instead of ``options.get()`` and no longer perform " "any type coercion. This could be a problem if you're calling commands using " "``Command.execute()`` (which bypasses the argument parser that sets a " "default value) instead of :func:`~django.core.management.call_command`. " "Instead of calling ``Command.execute()``, pass the command object as the " "first argument to ``call_command()``." msgstr "" "内置管理命令现在使用 ``options`` 中键的索引,例如 ``options['verbosity']``," "而不是 ``options.get()``,并且不再执行任何类型强制转换。如果你正在使用 " "``Command.execute()`` 调用命令(绕过设置默认值的参数解析器),而不是 :func:" "`~django.core.management.call_command`,这可能会导致问题。不要调用 ``Command." "execute()``,而是将命令对象作为第一个参数传递给 ``call_command()``。" msgid "" ":class:`~django.contrib.auth.backends.ModelBackend` and :class:`~django." "contrib.auth.backends.RemoteUserBackend` now reject inactive users. This " "means that inactive users can't login and will be logged out if they are " "switched from ``is_active=True`` to ``False``. If you need the previous " "behavior, use the new :class:`~django.contrib.auth.backends." "AllowAllUsersModelBackend` or :class:`~django.contrib.auth.backends." "AllowAllUsersRemoteUserBackend` in :setting:`AUTHENTICATION_BACKENDS` " "instead." msgstr "" ":class:`~django.contrib.auth.backends.ModelBackend` 和 :class:`~django." "contrib.auth.backends.RemoteUserBackend` 现在会拒绝不活跃的用户。这意味着不活" "跃的用户无法登录,如果将他们从 ``is_active=True`` 更改为 ``False``,他们将被" "登出。如果需要以前的行为,请在 :setting:`AUTHENTICATION_BACKENDS` 中使用新" "的 :class:`~django.contrib.auth.backends.AllowAllUsersModelBackend` 或 :" "class:`~django.contrib.auth.backends.AllowAllUsersRemoteUserBackend`。" msgid "" "In light of the previous change, the test client's :meth:`~django.test." "Client.login()` method no longer always rejects inactive users but instead " "delegates this decision to the authentication backend. :meth:`~django.test." "Client.force_login()` also delegates the decision to the authentication " "backend, so if you're using the default backends, you need to use an active " "user." msgstr "" "鉴于先前的更改,测试客户端的 :meth:`~django.test.Client.login()` 方法不再始终" "拒绝不活跃的用户,而是将这个决定委托给身份验证后端。 :meth:`~django.test." "Client.force_login()` 也将决定委托给身份验证后端,因此如果你使用默认的后端," "你需要使用一个活跃的用户。" msgid "" ":func:`django.views.i18n.set_language` may now return a 204 status code for " "AJAX requests." msgstr "" ":func:`django.views.i18n.set_language` 现在可以为 AJAX 请求返回一个 204 状态" "码。" msgid "" "The ``base_field`` attribute of :class:`~django.contrib.postgres.fields." "RangeField` is now a type of field, not an instance of a field. If you have " "created a custom subclass of :class:`~django.contrib.postgres.fields." "RangeField`, you should change the ``base_field`` attribute." msgstr "" ":class:`~django.contrib.postgres.fields.RangeField` 的 ``base_field`` 属性现" "在是一个字段类型,而不是字段的实例。如果你创建了 :class:`~django.contrib." "postgres.fields.RangeField` 的自定义子类,你应该更改 ``base_field`` 属性。" msgid "" "Middleware classes are now initialized when the server starts rather than " "during the first request." msgstr "现在,中间件类在服务器启动时初始化,而不是在第一个请求期间。" msgid "" "If you override ``is_authenticated()`` or ``is_anonymous()`` in a custom " "user model, you must convert them to attributes or properties as described " "in :ref:`the deprecation note `." msgstr "" "如果你在自定义用户模型中重写了 ``is_authenticated()`` 或 ``is_anonymous()`` " "方法,你必须将它们转换为属性或属性,如 :ref:`弃用说明 ` 中所述。" msgid "" "When using :attr:`ModelAdmin.save_as=True `, the \"Save as new\" button now redirects to the change view for " "the new object instead of to the model's changelist. If you need the " "previous behavior, set the new :attr:`ModelAdmin.save_as_continue ` attribute to ``False``." msgstr "" "当使用 :attr:`ModelAdmin.save_as=True ` 时,\"Save as new\" 按钮现在会重定向到新对象的修改视图,而不是模型" "的变更列表。如果你需要之前的行为,请将新的 :attr:`ModelAdmin." "save_as_continue ` 属性设置" "为 ``False``。" msgid "" "Required form fields now have the ``required`` HTML attribute. Set the :attr:" "`Form.use_required_attribute ` " "attribute to ``False`` to disable it. You could also add the ``novalidate`` " "attribute to ``
`` if you don't want browser validation. To disable the " "``required`` attribute on custom widgets, override the :meth:`Widget." "use_required_attribute() ` " "method." msgstr "" "必填的表单字段现在具有 ``required`` HTML 属性。如果要禁用它,请将 :attr:" "`Form.use_required_attribute ` 属性" "设置为 ``False``。如果不想要浏览器验证,还可以在 ```` 中添加 " "``novalidate`` 属性。如果要在自定义小部件上禁用 ``required`` 属性,请重写 :" "meth:`Widget.use_required_attribute() ` 方法。" msgid "" "The WSGI handler no longer removes content of responses from ``HEAD`` " "requests or responses with a ``status_code`` of 100-199, 204, or 304. Most " "web servers already implement this behavior. Responses retrieved using the " "Django test client continue to have these \"response fixes\" applied." msgstr "" "WSGI 处理程序不再从 ``HEAD`` 请求或具有 ``status_code`` 为 100-199、204 或 " "304 的响应中删除内容。大多数 Web 服务器已经实现了这种行为。使用 Django 测试客" "户端检索的响应仍然会应用这些 \"响应修复\"。" msgid "" "``Model.__init__()`` now receives ``django.db.models.DEFERRED`` as the value " "of deferred fields." msgstr "" "``Model.__init__()`` 现在会将 ``django.db.models.DEFERRED`` 作为延迟字段的" "值。" msgid "" "The ``Model._deferred`` attribute is removed as dynamic model classes when " "using ``QuerySet.defer()`` and ``only()`` is removed." msgstr "" "``Model._deferred`` 属性在使用 ``QuerySet.defer()`` 和 ``only()`` 时动态模型" "类被移除。" msgid "" ":meth:`Storage.save() ` no longer " "replaces ``'\\'`` with ``'/'``. This behavior is moved to :class:`~django." "core.files.storage.FileSystemStorage` since this is a storage specific " "implementation detail. Any Windows user with a custom storage implementation " "that relies on this behavior will need to implement it in the custom " "storage's ``save()`` method." msgstr "" ":meth:`Storage.save() ` 不再将 " "``'\\'`` 替换为 ``'/'``。这个行为已经移到 :class:`~django.core.files.storage." "FileSystemStorage` 中,因为这是一个与存储相关的具体实现细节。如果有自定义存储" "实现依赖这个行为的 Windows 用户,需要在自定义存储的 ``save()`` 方法中实现这个" "行为。" msgid "" "Private :class:`~django.db.models.FileField` methods " "``get_directory_name()`` and ``get_filename()`` are no longer called (and " "are now deprecated) which is a backwards incompatible change for users " "overriding those methods on custom fields. To adapt such code, override " "``FileField.generate_filename()`` or :meth:`Storage.generate_filename() " "` instead. It might be " "possible to use :attr:`~django.db.models.FileField.upload_to` also." msgstr "" "私有的 :class:`~django.db.models.FileField` 方法 ``get_directory_name()`` 和 " "``get_filename()`` 不再被调用(并且现在已被弃用),这对于在自定义字段上重写这" "些方法的用户来说是一个不兼容的变更。要适应这种代码,可以重写 ``FileField." "generate_filename()`` 或 :meth:`Storage.generate_filename() `。也可能可以使用 :attr:`~django.db." "models.FileField.upload_to`。" msgid "" "The subject of mail sent by ``AdminEmailHandler`` is no longer truncated at " "989 characters. If you were counting on a limited length, truncate the " "subject yourself." msgstr "" "由 ``AdminEmailHandler`` 发送的邮件主题不再在 989 个字符处截断。如果你依赖于" "有限的长度,请自行截断主题。" msgid "" "Private expressions ``django.db.models.expressions.Date`` and ``DateTime`` " "are removed. The new :class:`~django.db.models.functions.Trunc` expressions " "provide the same functionality." msgstr "" "私有表达式 ``django.db.models.expressions.Date`` 和 ``DateTime`` 已被移除。新" "的 :class:`~django.db.models.functions.Trunc` 表达式提供了相同的功能。" msgid "" "The ``_base_manager`` and ``_default_manager`` attributes are removed from " "model instances. They remain accessible on the model class." msgstr "" "模型实例中的 ``_base_manager`` 和 ``_default_manager`` 属性已被移除。您仍然可" "以在模型类上访问它们。" msgid "" "Accessing a deleted field on a model instance, e.g. after ``del obj.field``, " "reloads the field's value instead of raising ``AttributeError``." msgstr "" "在模型实例上访问已删除的字段(例如,在执行 ``del obj.field`` 后)将重新加载字" "段的值,而不会引发 ``AttributeError``。" msgid "" "If you subclass ``AbstractBaseUser`` and override ``clean()``, be sure it " "calls ``super()``. :meth:`.AbstractBaseUser.normalize_username` is called in " "a new :meth:`.AbstractBaseUser.clean` method." msgstr "" "如果您子类化了 ``AbstractBaseUser`` 并覆盖了 ``clean()`` 方法,请确保在其中调" "用 ``super()``。现在在新的 :meth:`.AbstractBaseUser.clean` 方法中调用了 :" "meth:`.AbstractBaseUser.normalize_username`。" msgid "" "Private API ``django.forms.models.model_to_dict()`` returns a queryset " "rather than a list of primary keys for ``ManyToManyField``\\s." msgstr "" "私有 API ``django.forms.models.model_to_dict()`` 现在返回一个查询集而不是 " "``ManyToManyField`` 的主键列表。" msgid "" "If ``django.contrib.staticfiles`` is installed, the :ttag:`static` template " "tag uses the ``staticfiles`` storage to construct the URL rather than simply " "joining the value with ``STATIC_ROOT``. The new approach encodes the URL, " "which could be backwards-incompatible in cases such as including a fragment " "in a path, e.g. ``{% static 'img.svg#fragment' %}``, since the ``#`` is " "encoded as ``%23``. To adapt, move the fragment outside the template tag: " "``{% static 'img.svg' %}#fragment``." msgstr "" "如果安装了 ``django.contrib.staticfiles``,那么 :ttag:`static` 模板标签将使" "用 ``staticfiles`` 存储来构建 URL,而不仅仅是与 ``STATIC_ROOT`` 连接。这种新" "方法对URL进行了编码,可能在包含路径中的片段的情况下存在向后不兼容性,例如 " "``{% static 'img.svg#fragment' %}``,因为 ``#`` 被编码为 ``%23``。要进行适" "应,将片段移到模板标签之外:``{% static 'img.svg' %}#fragment``。" msgid "" "When ``USE_L10N`` is ``True``, localization is now applied for the :tfilter:" "`date` and :tfilter:`time` filters when no format string is specified. The " "``DATE_FORMAT`` and ``TIME_FORMAT`` specifiers from the active locale are " "used instead of the settings of the same name." msgstr "" "当 ``USE_L10N`` 为 ``True`` 时,如果没有指定格式字符串,则 :tfilter:`date` " "和 :tfilter:`time` 过滤器现在会应用本地化。它们将使用活动区域设置中的 " "``DATE_FORMAT`` 和 ``TIME_FORMAT`` 指示符,而不是同名的设置。" msgid "Features deprecated in 1.10" msgstr "在 1.10 中被废弃的功能" msgid "Direct assignment to a reverse foreign key or many-to-many relation" msgstr "直接分配给反向外键或多对多关系" msgid "Instead of assigning related objects using direct assignment:" msgstr "不要使用直接分配来分配相关对象:" msgid "" "Use the :meth:`~django.db.models.fields.related.RelatedManager.set` method " "added in Django 1.9:" msgstr "" "使用 Django 1.9 中添加的 :meth:`~django.db.models.fields.related." "RelatedManager.set` 方法:" msgid "" "This prevents confusion about an assignment resulting in an implicit save." msgstr "这可以避免因隐式保存导致的分配混淆。" msgid "Non-timezone-aware :class:`~django.core.files.storage.Storage` API" msgstr "非时区感知的 :class:`~django.core.files.storage.Storage` API" msgid "" "The old, non-timezone-aware methods ``accessed_time()``, ``created_time()``, " "and ``modified_time()`` are deprecated in favor of the new ``get_*_time()`` " "methods." msgstr "" "旧的、非时区感知的方法 ``accessed_time()``, ``created_time()``, 和 " "``modified_time()`` 已被弃用,推荐使用新的 ``get_*_time()`` 方法。" msgid "" "Third-party storage backends should implement the new methods and mark the " "old ones as deprecated. Until then, the new ``get_*_time()`` methods on the " "base :class:`~django.core.files.storage.Storage` class convert " "``datetime``\\s from the old methods as required and emit a deprecation " "warning as they do so." msgstr "" "第三方存储后端应该实现新的方法并将旧的方法标记为弃用。在此之前,基础的 :" "class:`~django.core.files.storage.Storage` 类上的新的 ``get_*_time()`` 方法将" "根据需要将来自旧方法的 ``datetime`` 转换并在这样做时发出弃用警告。" msgid "" "Third-party storage backends may retain the old methods as long as they wish " "to support earlier versions of Django." msgstr "只要第三方存储后端希望支持早期版本的 Django,它们就可以保留旧方法。" msgid "" "The ``get_srid()`` and ``set_srid()`` methods of :class:`~django.contrib.gis." "geos.GEOSGeometry` are deprecated in favor of the :attr:`~django.contrib.gis." "geos.GEOSGeometry.srid` property." msgstr "" ":class:`~django.contrib.gis.geos.GEOSGeometry` 的 ``get_srid()`` 和 " "``set_srid()`` 方法已被弃用,推荐使用 :attr:`~django.contrib.gis.geos." "GEOSGeometry.srid` 属性。" msgid "" "The ``get_x()``, ``set_x()``, ``get_y()``, ``set_y()``, ``get_z()``, and " "``set_z()`` methods of :class:`~django.contrib.gis.geos.Point` are " "deprecated in favor of the ``x``, ``y``, and ``z`` properties." msgstr "" ":class:`~django.contrib.gis.geos.Point` 的 ``get_x()``, ``set_x()``, " "``get_y()``, ``set_y()``, ``get_z()``, 和 ``set_z()`` 方法已被弃用,推荐使用 " "``x``, ``y``, 和 ``z`` 属性。" msgid "" "The ``get_coords()`` and ``set_coords()`` methods of :class:`~django.contrib." "gis.geos.Point` are deprecated in favor of the ``tuple`` property." msgstr "" ":class:`~django.contrib.gis.geos.Point` 的 ``get_coords()`` 和 " "``set_coords()`` 方法已被弃用,推荐使用 ``tuple`` 属性。" msgid "" "The ``cascaded_union`` property of :class:`~django.contrib.gis.geos." "MultiPolygon` is deprecated in favor of the :attr:`~django.contrib.gis.geos." "GEOSGeometry.unary_union` property." msgstr "" ":class:`~django.contrib.gis.geos.MultiPolygon` 的 ``cascaded_union`` 属性已被" "弃用,推荐使用 :attr:`~django.contrib.gis.geos.GEOSGeometry.unary_union` 属" "性。" msgid "" "The ``django.contrib.gis.utils.precision_wkt()`` function is deprecated in " "favor of :class:`~django.contrib.gis.geos.WKTWriter`." msgstr "" "``django.contrib.gis.utils.precision_wkt()`` 函数已被弃用,推荐使用 :class:" "`~django.contrib.gis.geos.WKTWriter`。" msgid "``CommaSeparatedIntegerField`` model field" msgstr "``CommaSeparatedIntegerField`` 模型字段" msgid "" "``CommaSeparatedIntegerField`` is deprecated in favor of :class:`~django.db." "models.CharField` with the :func:`~django.core.validators." "validate_comma_separated_integer_list` validator::" msgstr "" "``CommaSeparatedIntegerField`` 已被弃用,推荐使用 :class:`~django.db.models." "CharField` 并配合 :func:`~django.core.validators." "validate_comma_separated_integer_list` 验证器使用:" msgid "" "If you're using Oracle, ``CharField`` uses a different database field type " "(``NVARCHAR2``) than ``CommaSeparatedIntegerField`` (``VARCHAR2``). " "Depending on your database settings, this might imply a different encoding, " "and thus a different length (in bytes) for the same contents. If your stored " "values are longer than the 4000 byte limit of ``NVARCHAR2``, you should use " "``TextField`` (``NCLOB``) instead. In this case, if you have any queries " "that group by the field (e.g. annotating the model with an aggregation or " "using ``distinct()``) you'll need to change them (to defer the field)." msgstr "" "如果您使用的是 Oracle 数据库,``CharField`` 使用不同的数据库字段类型" "(``NVARCHAR2``)而不是 ``CommaSeparatedIntegerField`` (``VARCHAR2``)。根据" "您的数据库设置,这可能意味着相同内容的不同编码,从而导致相同内容的不同字节长" "度。如果您存储的值长于 ``NVARCHAR2`` 的 4000 字节限制,您应该改用 " "``TextField`` (``NCLOB``)。在这种情况下,如果您有任何按字段分组的查询(例" "如,使用聚合注释模型或使用 ``distinct()``),您需要更改它们(以延迟字段)。" msgid "" "Using a model name as a query lookup when ``default_related_name`` is set" msgstr "当设置了 ``default_related_name`` 时,可以使用模型名称作为查询查找。" msgid "Assume the following models::" msgstr "假设以下模型:" msgid "" "In older versions, :attr:`~django.db.models.Options.default_related_name` " "couldn't be used as a query lookup. This is fixed and support for the old " "lookup name is deprecated. For example, since ``default_related_name`` is " "set in model ``Bar``, instead of using the model name ``bar`` as the lookup:" msgstr "" "在较旧的版本中,不能将 :attr:`~django.db.models.Options." "default_related_name` 用作查询查找。这已经得到修复,并且不再支持旧的查找名" "称。例如,由于在模型 ``Bar`` 中设置了 ``default_related_name``,所以不再使用" "模型名称 ``bar`` 作为查找:" msgid "use the default_related_name ``bars``:" msgstr "使用 ``default_related_name`` 中的 ``bars``:" msgid "``__search`` query lookup" msgstr "``__search`` 查询查找" msgid "" "The ``search`` lookup, which supports MySQL only and is extremely limited in " "features, is deprecated. Replace it with a custom lookup::" msgstr "" "``search`` 查询查找已被弃用,它仅支持 MySQL,并且功能非常有限。请将其替换为自" "定义查询查找:" msgid "" "Using ``User.is_authenticated()`` and ``User.is_anonymous()`` as methods" msgstr "使用 ``User.is_authenticated()`` 和 ``User.is_anonymous()`` 作为方法。" msgid "" "The ``is_authenticated()`` and ``is_anonymous()`` methods of :class:`~django." "contrib.auth.models.AbstractBaseUser` and :class:`~django.contrib.auth." "models.AnonymousUser` classes are now properties. They will still work as " "methods until Django 2.0, but all usage in Django now uses attribute access." msgstr "" ":class:`~django.contrib.auth.models.AbstractBaseUser` 和 :class:`~django." "contrib.auth.models.AnonymousUser` 类的 ``is_authenticated()`` 和 " "``is_anonymous()`` 方法现在已经变成属性。它们在 Django 2.0 之前仍然作为方法使" "用,但在 Django 中的所有用法现在都使用属性访问。" msgid "" "For example, if you use :class:`~django.contrib.auth.middleware." "AuthenticationMiddleware` and want to know whether the user is currently " "logged-in you would use::" msgstr "" "例如,如果您使用 :class:`~django.contrib.auth.middleware." "AuthenticationMiddleware` 并想知道用户当前是否已登录,您可以使用以下方式:" msgid "instead of ``request.user.is_authenticated()``." msgstr "而不是 ``request.user.is_authenticated()``。" msgid "" "This change avoids accidental information leakage if you forget to call the " "method, e.g.::" msgstr "此更改可以避免在您忘记调用方法时意外泄露信息,例如:" msgid "" "If you override these methods in a custom user model, you must change them " "to properties or attributes." msgstr "如果你在自定义用户模型中重写了这些方法,你必须将它们更改为属性或特性。" msgid "" "Django uses a ``CallableBool`` object to allow these attributes to work as " "both a property and a method. Thus, until the deprecation period ends, you " "cannot compare these properties using the ``is`` operator. That is, the " "following won't work::" msgstr "" "Django 使用一个 ``CallableBool`` 对象,以使这些属性同时可以作为属性和方法工" "作。因此,在弃用期结束之前,您不能使用 ``is`` 运算符比较这些属性。也就是说," "以下操作不起作用:" msgid "" "Custom manager classes available through ``prefetch_related`` must define a " "``_apply_rel_filters()`` method" msgstr "" "通过 ``prefetch_related`` 可用的自定义管理器类必须定义一个 " "``_apply_rel_filters()`` 方法。" msgid "" "If you defined a custom manager class available through :meth:`~django.db." "models.query.QuerySet.prefetch_related` you must make sure it defines a " "``_apply_rel_filters()`` method." msgstr "" "如果您定义了一个通过 :meth:`~django.db.models.query.QuerySet." "prefetch_related` 可用的自定义管理器类,您必须确保它定义了一个 " "``_apply_rel_filters()`` 方法。" msgid "" "This method must accept a :class:`~django.db.models.query.QuerySet` instance " "as its single argument and return a filtered version of the queryset for the " "model instance the manager is bound to." msgstr "" "这个方法必须接受一个 :class:`~django.db.models.query.QuerySet` 实例作为其唯一" "参数,并返回与管理器绑定的模型实例的经过筛选的查询集的版本。" msgid "The \"escape\" half of ``django.utils.safestring``" msgstr "``django.utils.safestring`` 的 \"escape\" 部分" msgid "" "The ``mark_for_escaping()`` function and the classes it uses: " "``EscapeData``, ``EscapeBytes``, ``EscapeText``, ``EscapeString``, and " "``EscapeUnicode`` are deprecated." msgstr "" "``mark_for_escaping()`` 函数以及它使用的类:``EscapeData``、``EscapeBytes``、" "``EscapeText``、``EscapeString`` 和 ``EscapeUnicode`` 已被弃用。" msgid "" "As a result, the \"lazy\" behavior of the ``escape`` filter (where it would " "always be applied as the last filter no matter where in the filter chain it " "appeared) is deprecated. The filter will change to immediately apply :func:" "`~django.utils.html.conditional_escape` in Django 2.0." msgstr "" "因此,``escape`` 过滤器的 \"懒惰\" 行为(无论在过滤器链的哪个位置,它始终作为" "最后一个过滤器应用)已被弃用。在 Django 2.0 中,该过滤器将立即应用 :func:" "`~django.utils.html.conditional_escape`。" msgid "``Manager.use_for_related_fields`` and inheritance changes" msgstr "``Manager.use_for_related_fields`` 和继承方面的变化" msgid "" "``Manager.use_for_related_fields`` is deprecated in favor of setting :attr:" "`Meta.base_manager_name ` on the " "model." msgstr "" "``Manager.use_for_related_fields`` 已被弃用,推荐在模型上设置 :attr:`Meta." "base_manager_name `。" msgid "" "Model ``Manager`` inheritance will follow MRO inheritance rules in Django " "2.0, changing the current behavior where managers defined on non-abstract " "base classes aren't inherited by child classes. A deprecating warning with " "instructions on how to adapt your code is raised if you have any affected " "managers. You'll either redeclare a manager from an abstract model on the " "child class to override the manager from the concrete model, or you'll set " "the model's ``Meta.manager_inheritance_from_future=True`` option to opt-in " "to the new inheritance behavior." msgstr "" "在 Django 2.0 中,模型 ``Manager`` 的继承将遵循 MRO 继承规则,改变了当前的行" "为,其中在非抽象基类上定义的管理器不会被子类继承。如果您有任何受影响的管理" "器,将会引发一个带有关于如何调整代码的弃用警告。您可以在子类上重新声明来自抽" "象模型的管理器,以覆盖来自具体模型的管理器,或者您可以设置模型的 ``Meta." "manager_inheritance_from_future=True`` 选项,以选择新的继承行为。" msgid "" "During the deprecation period, ``use_for_related_fields`` will be honored " "and raise a warning, even if a ``base_manager_name`` is set. This allows " "third-party code to preserve legacy behavior while transitioning to the new " "API. The warning can be silenced by setting " "``silence_use_for_related_fields_deprecation=True`` on the manager." msgstr "" "在弃用期间,即使设置了 ``base_manager_name``,也会尊重 " "``use_for_related_fields`` 并引发警告。这允许第三方代码在过渡到新的 API 时保" "留传统行为。可以通过在管理器上设置 " "``silence_use_for_related_fields_deprecation=True`` 来消除警告。" msgid "" "The ``makemigrations --exit`` option is deprecated in favor of the :option:" "`makemigrations --check` option." msgstr "" "``makemigrations --exit`` 选项已被弃用,推荐使用 :option:`makemigrations --" "check` 选项。" msgid "" "``django.utils.functional.allow_lazy()`` is deprecated in favor of the new :" "func:`~django.utils.functional.keep_lazy` function which can be used with a " "more natural decorator syntax." msgstr "" "``django.utils.functional.allow_lazy()`` 已被弃用,推荐使用新的 :func:" "`~django.utils.functional.keep_lazy` 函数,它可以使用更自然的装饰器语法。" msgid "" "The ``shell --plain`` option is deprecated in favor of ``-i python`` or ``--" "interface python``." msgstr "" "``shell --plain`` 选项已被弃用,推荐使用 ``-i python`` 或 ``--interface " "python``。" msgid "" "Importing from the ``django.core.urlresolvers`` module is deprecated in " "favor of its new location, :mod:`django.urls`." msgstr "" "从 ``django.core.urlresolvers`` 模块导入已被弃用,推荐使用其新位置 :mod:" "`django.urls`。" msgid "" "The template ``Context.has_key()`` method is deprecated in favor of ``in``." msgstr "模板中的 ``Context.has_key()`` 方法已被弃用,推荐使用 ``in``。" msgid "" "The private attribute ``virtual_fields`` of ``Model._meta`` is deprecated in " "favor of ``private_fields``." msgstr "" "``Model._meta`` 的私有属性 ``virtual_fields`` 已被弃用,推荐使用 " "``private_fields``。" msgid "" "The private keyword arguments ``virtual_only`` in ``Field." "contribute_to_class()`` and ``virtual`` in ``Model._meta.add_field()`` are " "deprecated in favor of ``private_only`` and ``private``, respectively." msgstr "" "``Field.contribute_to_class()`` 中的私有关键字参数 ``virtual_only`` 和 " "``Model._meta.add_field()`` 中的 ``virtual`` 已被弃用,分别推荐使用 " "``private_only`` 和 ``private``。" msgid "" "The ``javascript_catalog()`` and ``json_catalog()`` views are deprecated in " "favor of class-based views :class:`~django.views.i18n.JavaScriptCatalog` " "and :class:`~django.views.i18n.JSONCatalog`." msgstr "" "``javascript_catalog()`` 和 ``json_catalog()`` 视图已被弃用,推荐使用基于类的" "视图 :class:`~django.views.i18n.JavaScriptCatalog` 和 :class:`~django.views." "i18n.JSONCatalog`。" msgid "" "In multi-table inheritance, implicit promotion of a ``OneToOneField`` to a " "``parent_link`` is deprecated. Add ``parent_link=True`` to such fields." msgstr "" "在多表继承中,将一个 ``OneToOneField`` 隐式提升为 ``parent_link`` 已被弃用。" "应该在这些字段上添加 ``parent_link=True``。" msgid "" "The private API ``Widget._format_value()`` is made public and renamed to :" "meth:`~django.forms.Widget.format_value`. The old name will work through a " "deprecation period." msgstr "" "私有 API ``Widget._format_value()`` 已被公开,并重命名为 :meth:`~django." "forms.Widget.format_value`。旧名称将在弃用期间继续工作。" msgid "" "Private ``FileField`` methods ``get_directory_name()`` and " "``get_filename()`` are deprecated in favor of performing this work in :meth:" "`Storage.generate_filename() `)." msgstr "" "私有的 ``FileField`` 方法 ``get_directory_name()`` 和 ``get_filename()`` 已被" "弃用,推荐在 :meth:`Storage.generate_filename() ` 中执行这项工作。" msgid "" "Old-style middleware that uses ``settings.MIDDLEWARE_CLASSES`` are " "deprecated. :ref:`Adapt old, custom middleware ` and " "use the new :setting:`MIDDLEWARE` setting." msgstr "" "使用 ``settings.MIDDLEWARE_CLASSES`` 的旧式中间件已被弃用。请 :ref:`适应旧的" "自定义中间件 ` 并使用新的 :setting:`MIDDLEWARE` 设置。" msgid "Features removed in 1.10" msgstr "在 1.10 中移除的功能" msgid "" "These features have reached the end of their deprecation cycle and are " "removed in Django 1.10. See :ref:`deprecated-features-1.8` for details, " "including how to remove usage of these features." msgstr "" "这些功能已经完成了弃用周期,并在 Django 1.10 中被移除。有关详细信息,包括如何" "移除这些功能的用法,请参阅 :ref:`deprecated-features-1.8`。" msgid "" "Support for calling a ``SQLCompiler`` directly as an alias for calling its " "``quote_name_unless_alias`` method is removed." msgstr "" "不再支持直接调用 ``SQLCompiler`` 作为调用其 ``quote_name_unless_alias`` 方法" "的别名。" msgid "" "The ``cycle`` and ``firstof`` template tags are removed from the ``future`` " "template tag library." msgstr "``cycle`` 和 ``firstof`` 模板标签已从 ``future`` 模板标签库中移除。" msgid "``django.conf.urls.patterns()`` is removed." msgstr "``django.conf.urls.patterns()`` 已被移除。" msgid "" "Support for the ``prefix`` argument to ``django.conf.urls.i18n." "i18n_patterns()`` is removed." msgstr "" "不再支持 ``prefix`` 参数用于 ``django.conf.urls.i18n.i18n_patterns()``。" msgid "``SimpleTestCase.urls`` is removed." msgstr "``SimpleTestCase.urls`` 已被移除。" msgid "" "Using an incorrect count of unpacked values in the ``for`` template tag " "raises an exception rather than failing silently." msgstr "" "在模板标签 ``for`` 中使用不正确数量的解包值将引发异常,而不是默默失败。" msgid "" "The ability to :func:`~django.urls.reverse` URLs using a dotted Python path " "is removed." msgstr "" "使用点分隔的 Python 路径反向 :func:`~django.urls.reverse` URL 的能力已被移" "除。" msgid "" "The ability to use a dotted Python path for the ``LOGIN_URL`` and " "``LOGIN_REDIRECT_URL`` settings is removed." msgstr "" "使用点分隔的 Python 路径设置 ``LOGIN_URL`` 和 ``LOGIN_REDIRECT_URL`` 的能力已" "被移除。" msgid "Support for ``optparse`` is dropped for custom management commands." msgstr "自定义管理命令不再支持 ``optparse``。" msgid "The class ``django.core.management.NoArgsCommand`` is removed." msgstr "类 ``django.core.management.NoArgsCommand`` 已被移除。" msgid "``django.core.context_processors`` module is removed." msgstr "``django.core.context_processors`` 模块已被移除。" msgid "``django.db.models.sql.aggregates`` module is removed." msgstr "``django.db.models.sql.aggregates`` 模块已被移除。" msgid "``django.contrib.gis.db.models.sql.aggregates`` module is removed." msgstr "``django.contrib.gis.db.models.sql.aggregates`` 模块已被移除。" msgid "" "The following methods and properties of ``django.db.sql.query.Query`` are " "removed:" msgstr "以下 ``django.db.sql.query.Query`` 的方法和属性已被移除:" msgid "Properties: ``aggregates`` and ``aggregate_select``" msgstr "属性:``aggregates`` 和 ``aggregate_select`` 将被移除。" msgid "" "Methods: ``add_aggregate``, ``set_aggregate_mask``, and " "``append_aggregate_mask``." msgstr "" "方法:``add_aggregate``、``set_aggregate_mask`` 和 ``append_aggregate_mask`` " "将被移除。" msgid "``django.template.resolve_variable`` is removed." msgstr "``django.template.resolve_variable`` 已被移除。" msgid "" "The following private APIs are removed from :class:`django.db.models.options." "Options` (``Model._meta``):" msgstr "" "以下私有 API 已从 :class:`django.db.models.options.Options` (``Model." "_meta``)中移除:" msgid "``get_field_by_name()``" msgstr "``get_field_by_name()``" msgid "``get_all_field_names()``" msgstr "``get_all_field_names()``" msgid "``get_fields_with_model()``" msgstr "``get_fields_with_model()``" msgid "``get_concrete_fields_with_model()``" msgstr "``get_concrete_fields_with_model()``" msgid "``get_m2m_with_model()``" msgstr "``get_m2m_with_model()``" msgid "``get_all_related_objects()``" msgstr "``get_all_related_objects()``" msgid "``get_all_related_objects_with_model()``" msgstr "``get_all_related_objects_with_model()``" msgid "``get_all_related_many_to_many_objects()``" msgstr "``get_all_related_many_to_many_objects()``" msgid "``get_all_related_m2m_objects_with_model()``" msgstr "``get_all_related_m2m_objects_with_model()``" msgid "" "The ``error_message`` argument of ``django.forms.RegexField`` is removed." msgstr "``django.forms.RegexField`` 的 ``error_message`` 参数已被移除。" msgid "The ``unordered_list`` filter no longer supports old style lists." msgstr "``unordered_list`` 过滤器不再支持旧式列表。" msgid "Support for string ``view`` arguments to ``url()`` is removed." msgstr "不再支持将字符串 ``view`` 参数传递给 ``url()``。" msgid "" "The backward compatible shim to rename ``django.forms.Form._has_changed()`` " "to ``has_changed()`` is removed." msgstr "" "将 ``django.forms.Form._has_changed()`` 重命名为 ``has_changed()`` 的向后兼容" "性修补程序已被移除。" msgid "The ``removetags`` template filter is removed." msgstr "``removetags`` 模板过滤器已被移除。" msgid "" "The ``remove_tags()`` and ``strip_entities()`` functions in ``django.utils." "html`` is removed." msgstr "" "``django.utils.html`` 中的 ``remove_tags()`` 和 ``strip_entities()`` 函数已被" "移除。" msgid "" "The ``is_admin_site`` argument to ``django.contrib.auth.views." "password_reset()`` is removed." msgstr "" "``django.contrib.auth.views.password_reset()`` 中的 ``is_admin_site`` 参数已" "被移除。" msgid "``django.db.models.field.subclassing.SubfieldBase`` is removed." msgstr "``django.db.models.field.subclassing.SubfieldBase`` 已被移除。" msgid "``django.utils.checksums`` is removed." msgstr "``django.utils.checksums`` 已被移除。" msgid "" "The ``original_content_type_id`` attribute on ``django.contrib.admin.helpers." "InlineAdminForm`` is removed." msgstr "" "``django.contrib.admin.helpers.InlineAdminForm`` 上的 " "``original_content_type_id`` 属性已被移除。" msgid "" "The backwards compatibility shim to allow ``FormMixin.get_form()`` to be " "defined with no default value for its ``form_class`` argument is removed." msgstr "" "允许不为其 ``form_class`` 参数定义默认值的 ``FormMixin.get_form()`` 的向后兼" "容性修复已被移除。" msgid "" "The following settings are removed, and you must upgrade to the :setting:" "`TEMPLATES` setting:" msgstr "以下设置已被移除,您必须升级到 :setting:`TEMPLATES` 设置:" msgid "``ALLOWED_INCLUDE_ROOTS``" msgstr "``ALLOWED_INCLUDE_ROOTS``" msgid "``TEMPLATE_CONTEXT_PROCESSORS``" msgstr "``TEMPLATE_CONTEXT_PROCESSORS``" msgid "``TEMPLATE_DEBUG``" msgstr "``TEMPLATE_DEBUG``" msgid "``TEMPLATE_DIRS``" msgstr "``TEMPLATE_DIRS``" msgid "``TEMPLATE_LOADERS``" msgstr "``TEMPLATE_LOADERS``" msgid "``TEMPLATE_STRING_IF_INVALID``" msgstr "``TEMPLATE_STRING_IF_INVALID``" msgid "" "The backwards compatibility alias ``django.template.loader.BaseLoader`` is " "removed." msgstr "向后兼容的别名 ``django.template.loader.BaseLoader`` 已被移除。" msgid "" "Django template objects returned by :func:`~django.template.loader." "get_template` and :func:`~django.template.loader.select_template` no longer " "accept a :class:`~django.template.Context` in their :meth:`~django.template." "backends.base.Template.render()` method." msgstr "" "由 :func:`~django.template.loader.get_template` 和 :func:`~django.template." "loader.select_template` 返回的 Django 模板对象不再在其 :meth:`~django." "template.backends.base.Template.render()` 方法中接受 :class:`~django." "template.Context`。" msgid "" ":doc:`Template response APIs ` enforce the use of :" "class:`dict` and backend-dependent template objects instead of :class:" "`~django.template.Context` and :class:`~django.template.Template` " "respectively." msgstr "" ":doc:`Template response APIs ` 强制使用 :class:" "`dict` 和依赖后端的模板对象,而不再使用 :class:`~django.template.Context` " "和 :class:`~django.template.Template`。" msgid "" "The ``current_app`` parameter for the following function and classes is " "removed:" msgstr "以下函数和类的 ``current_app`` 参数已被移除:" msgid "``django.shortcuts.render()``" msgstr "``django.shortcuts.render()``" msgid "``django.template.Context()``" msgstr "``django.template.Context()``" msgid "``django.template.RequestContext()``" msgstr "``django.template.RequestContext()``" msgid "``django.template.response.TemplateResponse()``" msgstr "``django.template.response.TemplateResponse()``" msgid "" "The ``dictionary`` and ``context_instance`` parameters for the following " "functions are removed:" msgstr "以下函数的 ``dictionary`` 和 ``context_instance`` 参数已被移除:" msgid "``django.shortcuts.render_to_response()``" msgstr "``django.shortcuts.render_to_response()``" msgid "``django.template.loader.render_to_string()``" msgstr "``django.template.loader.render_to_string()``" msgid "The ``dirs`` parameter for the following functions is removed:" msgstr "以下函数的 ``dirs`` 参数已被移除:" msgid "``django.template.loader.get_template()``" msgstr "``django.template.loader.get_template()``" msgid "``django.template.loader.select_template()``" msgstr "``django.template.loader.select_template()``" msgid "" "Session verification is enabled regardless of whether or not ``'django." "contrib.auth.middleware.SessionAuthenticationMiddleware'`` is in " "``MIDDLEWARE_CLASSES``. ``SessionAuthenticationMiddleware`` no longer has " "any purpose and can be removed from ``MIDDLEWARE_CLASSES``. It's kept as a " "stub until Django 2.0 as a courtesy for users who don't read this note." msgstr "" "会话验证现在已启用,无论是否在 ``MIDDLEWARE_CLASSES`` 中包含 ``'django." "contrib.auth.middleware.SessionAuthenticationMiddleware'``。" "``SessionAuthenticationMiddleware`` 不再有任何用途,可以从 " "``MIDDLEWARE_CLASSES`` 中删除。为了方便那些没有阅读此说明的用户,它被保留为一" "个存根,直到 Django 2.0。" msgid "Private attribute ``django.db.models.Field.related`` is removed." msgstr "私有属性 ``django.db.models.Field.related`` 已被移除。" msgid "The ``--list`` option of the ``migrate`` management command is removed." msgstr "``migrate`` 管理命令的 ``--list`` 选项已被移除。" msgid "The ``ssi`` template tag is removed." msgstr "``ssi`` 模板标签已被移除。" msgid "" "Support for the ``=`` comparison operator in the ``if`` template tag is " "removed." msgstr "不再支持 ``if`` 模板标签中的 ``=`` 比较运算符。" msgid "" "The backwards compatibility shims to allow ``Storage.get_available_name()`` " "and ``Storage.save()`` to be defined without a ``max_length`` argument are " "removed." msgstr "" "允许在不带 ``max_length`` 参数的情况下定义 ``Storage.get_available_name()`` " "和 ``Storage.save()`` 的向后兼容性修复已被移除。" msgid "" "Support for the legacy ``%()s`` syntax in ``ModelFormMixin." "success_url`` is removed." msgstr "" "在 ``ModelFormMixin.success_url`` 中移除了对旧式 ``%()s`` 语法的支持。" msgid "" "``GeoQuerySet`` aggregate methods ``collect()``, ``extent()``, " "``extent3d()``, ``make_line()``, and ``unionagg()`` are removed." msgstr "" "移除了``GeoQuerySet`` 聚合方法 ``collect()``, ``extent()``, ``extent3d()``, " "``make_line()``, 和 ``unionagg()``。" msgid "" "The ability to specify ``ContentType.name`` when creating a content type " "instance is removed." msgstr "在创建内容类型实例时不再支持指定 ``ContentType.name`` 的能力。" msgid "Support for the old signature of ``allow_migrate`` is removed." msgstr "不再支持旧的 ``allow_migrate`` 签名。" msgid "" "Support for the syntax of ``{% cycle %}`` that uses comma-separated " "arguments is removed." msgstr "移除了使用逗号分隔参数的 ``{% cycle %}`` 语法的支持。" msgid "" "The warning that :class:`~django.core.signing.Signer` issued when given an " "invalid separator is now a ``ValueError``." msgstr "" ":class:`~django.core.signing.Signer` 在提供无效的分隔符时发出的警告现在是一" "个 ``ValueError``。" msgid "Django 1.10.1 release notes" msgstr "Django 1.10.1 版本发行说明" msgid "*September 1, 2016*" msgstr "*2016 年 9 月 1 日*" msgid "Django 1.10.1 fixes several bugs in 1.10." msgstr "Django 1.10.1 修复了 1.10 中的几个漏洞。" msgid "Bugfixes" msgstr "漏洞修复" msgid "" "Fixed a crash in MySQL connections where ``SELECT @@SQL_AUTO_IS_NULL`` " "doesn't return a result (:ticket:`26991`)." msgstr "" "修复了 MySQL 连接中的一个崩溃问题,在该问题中 ``SELECT @@SQL_AUTO_IS_NULL`` " "不返回结果 (:ticket:`26991`)。" msgid "" "Allowed ``User.is_authenticated`` and ``User.is_anonymous`` properties to be " "compared using ``==``, ``!=``, and ``|`` (:ticket:`26988`, :ticket:`27154`)." msgstr "" "允许使用 ``==``、``!=`` 和 ``|`` 来比较 ``User.is_authenticated`` 和 ``User." "is_anonymous`` 属性 (:ticket:`26988`, :ticket:`27154`)。" msgid "" "Removed the broken ``BaseCommand.usage()`` method which was for ``optparse`` " "support (:ticket:`27000`)." msgstr "" "移除了已损坏的 ``BaseCommand.usage()`` 方法,该方法用于 ``optparse`` 支持 (:" "ticket:`27000`)。" msgid "" "Fixed a checks framework crash with an empty ``Meta.default_permissions`` (:" "ticket:`26997`)." msgstr "" "修复了一个检查框架在空的 ``Meta.default_permissions`` 时崩溃的问题 (:ticket:" "`26997`)。" msgid "" "Fixed a regression in the number of queries when using ``RadioSelect`` with " "a ``ModelChoiceField`` form field (:ticket:`27001`)." msgstr "" "修复了在使用 ``ModelChoiceField`` 表单字段时,使用 ``RadioSelect`` 时查询数量" "的回归问题 (:ticket:`27001`)。" msgid "" "Fixed a crash if ``request.META['CONTENT_LENGTH']`` is an empty string (:" "ticket:`27005`)." msgstr "" "如果 ``request.META['CONTENT_LENGTH']`` 是空字符串,修复了一个崩溃问题 (:" "ticket:`27005`)。" msgid "" "Fixed the ``isnull`` lookup on a ``ForeignKey`` with its ``to_field`` " "pointing to a ``CharField`` or pointing to a ``CharField`` defined with " "``primary_key=True`` (:ticket:`26983`)." msgstr "" "修复了在 ``ForeignKey`` 上使用 ``isnull`` 查找,其中 ``to_field`` 指向一个 " "``CharField`` 或指向一个使用 ``primary_key=True`` 定义的 ``CharField`` 时的问" "题 (:ticket:`26983`)。" msgid "" "Prevented the ``migrate`` command from raising " "``InconsistentMigrationHistory`` in the presence of unapplied squashed " "migrations (:ticket:`27004`)." msgstr "" "在存在未应用的压缩迁移的情况下,防止 ``migrate`` 命令引发 " "``InconsistentMigrationHistory`` 异常 (:ticket:`27004`)。" msgid "" "Fixed a regression in ``Client.force_login()`` which required specifying a " "``backend`` rather than automatically using the first one if multiple " "backends are configured (:ticket:`27027`)." msgstr "" "修复了 ``Client.force_login()`` 中的一个回归问题,该问题需要指定一个 " "``backend``,而不是在配置了多个后端的情况下自动使用第一个后端 (:ticket:" "`27027`)。" msgid "" "Made ``QuerySet.bulk_create()`` properly initialize model instances on " "backends, such as PostgreSQL, that support returning the IDs of the created " "records so that many-to-many relationships can be used on the new objects (:" "ticket:`27026`)." msgstr "" "在后端(例如 PostgreSQL)上使 ``QuerySet.bulk_create()`` 正确初始化模型实例," "以便支持返回已创建记录的 ID,以便可以在新对象上使用多对多关系 (:ticket:" "`27026`)。" msgid "" "Fixed crash of ``django.views.static.serve()`` with ``show_indexes`` enabled " "(:ticket:`26973`)." msgstr "" "修复了在启用 ``show_indexes`` 的情况下,``django.views.static.serve()`` 崩溃" "的问题 (:ticket:`26973`)。" msgid "" "Fixed ``ClearableFileInput`` to avoid the ``required`` HTML attribute when " "initial data exists (:ticket:`27037`)." msgstr "" "修复了 ``ClearableFileInput`` 在存在初始数据时避免生成 ``required`` HTML 属性" "的问题 (:ticket:`27037`)。" msgid "" "Fixed annotations with database functions when combined with lookups on " "PostGIS (:ticket:`27014`)." msgstr "" "修复了在与 PostGIS 结合使用时,带有数据库函数的注释问题 (:ticket:`27014`)。" msgid "" "Reallowed the ``{% for %}`` tag to unpack any iterable (:ticket:`27058`)." msgstr "重新允许 ``{% for %}`` 标签解包任何可迭代对象 (:ticket:`27058`)。" msgid "" "Made ``makemigrations`` skip inconsistent history checks on non-default " "databases if database routers aren't in use or if no apps can be migrated to " "the database (:ticket:`27054`, :ticket:`27110`, :ticket:`27142`)." msgstr "" "如果没有使用数据库路由器,或者没有应用可以迁移到数据库,则在非默认数据库上使 " "``makemigrations`` 跳过不一致的历史检查 (:ticket:`27054`, :ticket:`27110`, :" "ticket:`27142`)。" msgid "" "Removed duplicated managers in ``Model._meta.managers`` (:ticket:`27073`)." msgstr "移除了 ``Model._meta.managers`` 中的重复管理器 (:ticket:`27073`)。" msgid "" "Fixed ``contrib.admindocs`` crash when a view is in a class, such as some of " "the admin views (:ticket:`27018`)." msgstr "" "修复了 ``contrib.admindocs`` 在视图位于类中(例如某些管理视图)时崩溃的问题 " "(:ticket:`27018`)。" msgid "" "Reverted a few admin checks that checked ``field.many_to_many`` back to " "``isinstance(field, models.ManyToManyField)`` since it turned out the checks " "weren't suitable to be generalized like that (:ticket:`26998`)." msgstr "" "回滚了一些检查,这些检查将 ``field.many_to_many`` 检查回到 " "``isinstance(field, models.ManyToManyField)``,因为事实证明这些检查不适合这样" "泛化 (:ticket:`26998`)。" msgid "" "Added the database alias to the ``InconsistentMigrationHistory`` message " "raised by ``makemigrations`` and ``migrate`` (:ticket:`27089`)." msgstr "" "在 ``makemigrations`` 和 ``migrate`` 引发的 ``InconsistentMigrationHistory`` " "消息中添加了数据库别名 (:ticket:`27089`)。" msgid "" "Fixed the creation of ``ContentType`` and ``Permission`` objects for models " "of applications without migrations when calling the ``migrate`` command with " "no migrations to apply (:ticket:`27044`)." msgstr "" "在没有要应用的迁移时,通过调用 ``migrate`` 命令修复了在没有迁移的应用程序模型" "中创建 ``ContentType`` 和 ``Permission`` 对象的问题 (:ticket:`27044`)。" msgid "" "Included the already applied migration state changes in the ``Apps`` " "instance provided to the ``pre_migrate`` signal receivers to allow " "``ContentType`` renaming to be performed on model rename (:ticket:`27100`)." msgstr "" "在提供给 ``pre_migrate`` 信号接收器的 ``Apps`` 实例中包括已应用的迁移状态更" "改,以允许在模型重命名时执行 ``ContentType`` 重命名 (:ticket:`27100`)。" msgid "" "Reallowed subclassing ``UserCreationForm`` without ``USERNAME_FIELD`` in " "``Meta.fields`` (:ticket:`27111`)." msgstr "" "重新允许在 ``Meta.fields`` 中没有 ``USERNAME_FIELD`` 的情况下继承 " "``UserCreationForm`` (:ticket:`27111`)。" msgid "" "Fixed a regression in model forms where model fields with a ``default`` that " "didn't appear in POST data no longer used the ``default`` (:ticket:`27039`)." msgstr "" "修复了模型表单中的一个回归问题,即模型字段具有未出现在 POST 数据中的 " "``default`` 不再使用 ``default`` (:ticket:`27039`)。" msgid "Django 1.10.2 release notes" msgstr "Django 1.10.2 版本发行说明" msgid "*October 1, 2016*" msgstr "*2016 年 10 月 1 日*" msgid "Django 1.10.2 fixes several bugs in 1.10.1." msgstr "Django 1.10.2 修复了 1.10.1 中的几个漏洞。" msgid "" "Fixed a crash in MySQL database validation where ``SELECT @@sql_mode`` " "doesn't return a result (:ticket:`27180`)." msgstr "" "修复了 MySQL 数据库验证中的一个崩溃问题,其中 ``SELECT @@sql_mode`` 不返回结" "果 (:ticket:`27180`)。" msgid "" "Allowed combining ``contrib.postgres.search.SearchQuery`` with more than one " "``&`` or ``|`` operators (:ticket:`27143`)." msgstr "" "允许将 ``contrib.postgres.search.SearchQuery`` 与多个 ``&`` 或 ``|`` 操作符组" "合使用 (:ticket:`27143`)。" msgid "" "Disabled system check for URL patterns beginning with a '/' when " "``APPEND_SLASH=False`` (:ticket:`27238`)." msgstr "" "在 ``APPEND_SLASH=False`` 时,禁用了以 '/' 开头的 URL 模式的系统检查 (:" "ticket:`27238`)。" msgid "" "Fixed model form ``default`` fallback for ``CheckboxSelectMultiple``, " "``MultiWidget``, ``FileInput``, ``SplitDateTimeWidget``, " "``SelectDateWidget``, and ``SplitArrayWidget`` (:ticket:`27186`). Custom " "widgets affected by this issue should implement :meth:`~django.forms.Widget." "value_omitted_from_data`." msgstr "" "修复了模型表单中对于 ``CheckboxSelectMultiple``、``MultiWidget``、" "``FileInput``、``SplitDateTimeWidget``、``SelectDateWidget`` 和 " "``SplitArrayWidget`` 的 ``default`` 回退问题 (:ticket:`27186`)。受此问题影响" "的自定义小部件应该实现 :meth:`~django.forms.Widget.value_omitted_from_data`。" msgid "" "Fixed a crash in ``runserver`` logging during a \"Broken pipe\" error (:" "ticket:`27271`)." msgstr "" "修复了在 \"Broken pipe\" 错误期间 ``runserver`` 日志记录中的崩溃问题 (:" "ticket:`27271`)。" msgid "" "Fixed a regression where unchanged localized date/time fields were listed as " "changed in the admin's model history messages (:ticket:`27302`)." msgstr "" "修复了一个回归问题,即在管理员的模型历史消息中,未更改的本地化日期/时间字段被" "列为已更改 (:ticket:`27302`)。" msgid "Django 1.10.3 release notes" msgstr "Django 1.10.3 版本发行说明" msgid "*November 1, 2016*" msgstr "*2016 年 11 月 1 日*" msgid "Django 1.10.3 fixes two security issues and several bugs in 1.10.2." msgstr "Django 1.10.3 修复了 1.10.2 中的两个安全问题和几个漏洞。" msgid "User with hardcoded password created when running tests on Oracle" msgstr "在 Oracle 上运行测试时创建了带有硬编码密码的用户" msgid "" "When running tests with an Oracle database, Django creates a temporary " "database user. In older versions, if a password isn't manually specified in " "the database settings ``TEST`` dictionary, a hardcoded password is used. " "This could allow an attacker with network access to the database server to " "connect." msgstr "" "在使用 Oracle 数据库运行测试时,Django 会创建一个临时数据库用户。在旧版本中," "如果在数据库设置的 ``TEST`` 字典中没有手动指定密码,那么会使用硬编码的密码。" "这可能允许具有对数据库服务器的网络访问权限的攻击者连接到数据库。" msgid "" "This user is usually dropped after the test suite completes, but not when " "using the ``manage.py test --keepdb`` option or if the user has an active " "session (such as an attacker's connection)." msgstr "" "通常情况下,在测试套件完成后会删除此用户,但如果使用 ``manage.py test --" "keepdb`` 选项,或者用户有一个活动会话(例如攻击者的连接),则不会删除此用户。" msgid "A randomly generated password is now used for each test run." msgstr "现在每次测试运行都使用随机生成的密码。" msgid "DNS rebinding vulnerability when ``DEBUG=True``" msgstr "当 ``DEBUG=True`` 时,存在 DNS 重新绑定漏洞" msgid "" "Older versions of Django don't validate the ``Host`` header against " "``settings.ALLOWED_HOSTS`` when ``settings.DEBUG=True``. This makes them " "vulnerable to a `DNS rebinding attack `_." msgstr "" "在旧版本的 Django 中,当 ``settings.DEBUG=True`` 时,不会验证 ``Host`` 标头" "与 ``settings.ALLOWED_HOSTS`` 是否匹配。这使得它们容易受到 `DNS 重新绑定攻击 " "`_ 的威胁。" msgid "" "While Django doesn't ship a module that allows remote code execution, this " "is at least a cross-site scripting vector, which could be quite serious if " "developers load a copy of the production database in development or connect " "to some production services for which there's no development instance, for " "example. If a project uses a package like the ``django-debug-toolbar``, then " "the attacker could execute arbitrary SQL, which could be especially bad if " "the developers connect to the database with a superuser account." msgstr "" "虽然 Django 没有提供远程代码执行的模块,但这至少是一个跨站点脚本(XSS)的漏" "洞,如果开发人员在开发环境中加载了生产数据库的副本或连接到一些没有开发实例的" "生产服务,这可能会非常严重。如果项目使用类似 ``django-debug-toolbar`` 这样的" "包,攻击者可以执行任意的 SQL 查询,如果开发人员使用超级用户账户连接到数据库," "那么情况可能会特别糟糕。" msgid "" "``settings.ALLOWED_HOSTS`` is now validated regardless of ``DEBUG``. For " "convenience, if ``ALLOWED_HOSTS`` is empty and ``DEBUG=True``, the following " "variations of localhost are allowed ``['localhost', '127.0.0.1', '::1']``. " "If your local settings file has your production ``ALLOWED_HOSTS`` value, you " "must now omit it to get those fallback values." msgstr "" "现在无论 ``DEBUG`` 的值如何,都会验证 ``settings.ALLOWED_HOSTS``。为了方便起" "见,如果 ``ALLOWED_HOSTS`` 为空且 ``DEBUG=True``,则允许以下本地主机的变化 " "``['localhost', '127.0.0.1', '::1']``。如果您的本地设置文件中包含生产环境的 " "``ALLOWED_HOSTS`` 值,现在必须将其省略以获得这些备用值。" msgid "" "Allowed ``User.is_authenticated`` and ``User.is_anonymous`` properties to be " "tested for ``set`` membership (:ticket:`27309`)." msgstr "" "允许对 ``User.is_authenticated`` 和 ``User.is_anonymous`` 属性进行 ``set`` 成" "员测试 (:ticket:`27309`)。" msgid "" "Fixed a performance regression when running ``migrate`` in projects with " "``RenameModel`` operations (:ticket:`27279`)." msgstr "" "修复了在具有 ``RenameModel`` 操作的项目中运行 ``migrate`` 时的性能回归问题 (:" "ticket:`27279`)。" msgid "" "Added ``model_name`` to the ``allow_migrate()`` calls in ``makemigrations`` " "(:ticket:`27200`)." msgstr "" "在 ``makemigrations`` 中的 ``allow_migrate()`` 调用中添加了 ``model_name`` 参" "数 (:ticket:`27200`)。" msgid "" "Made the ``JavaScriptCatalog`` view respect the ``packages`` argument; " "previously it was ignored (:ticket:`27374`)." msgstr "" "使 ``JavaScriptCatalog`` 视图尊重 ``packages`` 参数;之前它会被忽略 (:ticket:" "`27374`)。" msgid "" "Fixed ``QuerySet.bulk_create()`` on PostgreSQL when the number of objects is " "a multiple plus one of ``batch_size`` (:ticket:`27385`)." msgstr "" "修复了在 PostgreSQL 上使用 ``QuerySet.bulk_create()`` 时,对象数量是 " "``batch_size`` 的倍数加一时的问题 (:ticket:`27385`)。" msgid "" "Prevented ``i18n_patterns()`` from using too much of the URL as the language " "to fix a use case for ``prefix_default_language=False`` (:ticket:`27063`)." msgstr "" "防止 ``i18n_patterns()`` 使用太多 URL 作为语言,以修复 " "``prefix_default_language=False`` 的用例 (:ticket:`27063`)。" msgid "" "Replaced a possibly incorrect redirect from ``SessionMiddleware`` when a " "session is destroyed in a concurrent request with a ``SuspiciousOperation`` " "to indicate that the request can't be completed (:ticket:`27363`)." msgstr "" "在并发请求中,将 ``SessionMiddleware`` 中可能不正确的重定向替换为 " "``SuspiciousOperation``,以指示请求无法完成 (:ticket:`27363`)。" msgid "Django 1.10.4 release notes" msgstr "Django 1.10.4 版本发行说明" msgid "*December 1, 2016*" msgstr "*2016 年 12 月 1 日*" msgid "Django 1.10.4 fixes several bugs in 1.10.3." msgstr "Django 1.10.4 修复了 1.10.3 中的几个漏洞。" msgid "" "Quoted the Oracle test user's password in queries to fix the \"ORA-00922: " "missing or invalid option\" error when the password starts with a number or " "special character (:ticket:`27420`)." msgstr "" "在查询中引用 Oracle 测试用户的密码,以修复密码以数字或特殊字符开头时出现 " "\"ORA-00922: missing or invalid option\" 错误的问题 (:ticket:`27420`)。" msgid "" "Fixed incorrect ``app_label`` / ``model_name`` arguments for " "``allow_migrate()`` in ``makemigrations`` migration consistency checks (:" "ticket:`27461`)." msgstr "" "修复了在 ``makemigrations`` 迁移一致性检查中的 ``allow_migrate()`` 中不正确" "的 ``app_label`` / ``model_name`` 参数 (:ticket:`27461`)。" msgid "" "Made ``Model.delete(keep_parents=True)`` preserve parent reverse " "relationships in multi-table inheritance (:ticket:`27407`)." msgstr "" "在多表继承中,通过 ``Model.delete(keep_parents=True)`` 保留父级反向关系 (:" "ticket:`27407`)。" msgid "" "Fixed a ``QuerySet.update()`` crash on SQLite when updating a " "``DateTimeField`` with an ``F()`` expression and a ``timedelta`` (:ticket:" "`27544`)." msgstr "" "修复了在 SQLite 上使用 ``QuerySet.update()`` 时,更新带有 ``F()`` 表达式和 " "``timedelta`` 的 ``DateTimeField`` 时发生的崩溃 (:ticket:`27544`)。" msgid "" "Prevented ``LocaleMiddleware`` from redirecting on URLs that should return " "404 when using ``prefix_default_language=False`` (:ticket:`27402`)." msgstr "" "在使用 ``prefix_default_language=False`` 时,防止 ``LocaleMiddleware`` 在应该" "返回 404 的 URL 上进行重定向 (:ticket:`27402`)。" msgid "" "Prevented an unnecessary index from being created on an InnoDB " "``ForeignKey`` when the field was added after the model was created (:ticket:" "`27558`)." msgstr "" "在模型创建后添加字段时,防止在 InnoDB ``ForeignKey`` 上创建不必要的索引 (:" "ticket:`27558`)。" msgid "Django 1.10.5 release notes" msgstr "Django 1.10.5 版本发行说明" msgid "*January 4, 2017*" msgstr "*2017 年 1 月 4 日*" msgid "Django 1.10.5 fixes several bugs in 1.10.4." msgstr "Django 1.10.5 修复了 1.10.4 中的几个漏洞。" msgid "" "Fixed a crash in the debug view if ``request.user`` can't be retrieved, such " "as if the database is unavailable (:ticket:`27567`)." msgstr "" "修复了在调试视图中出现的崩溃,如果无法检索 ``request.user``,例如如果数据库不" "可用 (:ticket:`27567`)。" msgid "" "Fixed occasional missing plural forms in ``JavaScriptCatalog`` (:ticket:" "`27418`)." msgstr "" "修复了偶尔在 ``JavaScriptCatalog`` 中丢失的复数形式 (:ticket:`27418`)。" msgid "" "Fixed a regression in the ``timesince`` and ``timeuntil`` filters that " "caused incorrect results for dates in a leap year (:ticket:`27637`)." msgstr "" "修复了 ``timesince`` 和 ``timeuntil`` 过滤器中的回归问题,导致闰年日期的结果" "不正确 (:ticket:`27637`)。" msgid "" "Fixed a regression where ``collectstatic`` overwrote newer files in remote " "storages (:ticket:`27658`)." msgstr "" "修复了 ``collectstatic`` 在远程存储中覆盖更新文件的回归问题 (:ticket:" "`27658`)。" msgid "Django 1.10.6 release notes" msgstr "Django 1.10.6 版本发行说明" msgid "*March 1, 2017*" msgstr "*2017 年 3 月 1 日*" msgid "Django 1.10.6 fixes several bugs in 1.10.5." msgstr "Django 1.10.6 修复了 1.10.5 中的几个漏洞。" msgid "" "Fixed ``ClearableFileInput``’s \"Clear\" checkbox on model form fields where " "the model field has a ``default`` (:ticket:`27805`)." msgstr "" "修复了在模型字段具有 ``default`` 的情况下,模型表单字段上的 " "``ClearableFileInput`` 的 \"Clear\" 复选框 (:ticket:`27805`)。" msgid "" "Fixed ``RequestDataTooBig`` and ``TooManyFieldsSent`` exceptions crashing " "rather than generating a bad request response (:ticket:`27820`)." msgstr "" "修复了 ``RequestDataTooBig`` 和 ``TooManyFieldsSent`` 异常崩溃而不是生成坏请" "求响应的问题 (:ticket:`27820`)。" msgid "" "Fixed a crash on Oracle and PostgreSQL when subtracting ``DurationField`` or " "``IntegerField`` from ``DateField`` (:ticket:`27828`)." msgstr "" "修复了在 Oracle 和 PostgreSQL 上从 ``DateField`` 中减去 ``DurationField`` 或 " "``IntegerField`` 时发生的崩溃问题 (:ticket:`27828`)。" msgid "" "Fixed query expression date subtraction accuracy on PostgreSQL for " "differences larger than a month (:ticket:`27856`)." msgstr "" "修复了在 PostgreSQL 上查询表达式日期相减的精度问题,适用于大于一个月的差异 (:" "ticket:`27856`)。" msgid "" "Fixed a ``GDALException`` raised by ``GDALClose`` on GDAL ≥ 2.0 (:ticket:" "`27479`)." msgstr "" "修复了在 GDAL ≥ 2.0 上由 ``GDALClose`` 引发的 ``GDALException`` (:ticket:" "`27479`)。" msgid "Django 1.10.7 release notes" msgstr "Django 1.10.7 版本发行说明" msgid "*April 4, 2017*" msgstr "*2017 年 4 月 4 日*" msgid "Django 1.10.7 fixes two security issues and a bug in 1.10.6." msgstr "Django 1.10.7 修复了 1.10.6 中的两个安全问题和一个错误。" msgid "" "CVE-2017-7233: Open redirect and possible XSS attack via user-supplied " "numeric redirect URLs" msgstr "" "CVE-2017-7233 :通过用户提供的数字重定向 URL 进行开放式重定向和可能的 XSS 攻" "击" msgid "" "Django relies on user input in some cases (e.g. ``django.contrib.auth.views." "login()`` and :doc:`i18n `) to redirect the user to an " "\"on success\" URL. The security check for these redirects (namely ``django." "utils.http.is_safe_url()``) considered some numeric URLs (e.g. " "``http:999999999``) \"safe\" when they shouldn't be." msgstr "" "Django 在某些情况下依赖用户输入(例如 ``django.contrib.auth.views.login()`` " "和 :doc:`i18n `) 来将用户重定向到“成功”URL。这些重定向的" "安全检查(即 ``django.utils.http.is_safe_url()``)认为一些数值 URL(例如 " "``http:999999999``)是“安全”的,但实际上它们不应该是安全的。" msgid "" "Also, if a developer relies on ``is_safe_url()`` to provide safe redirect " "targets and puts such a URL into a link, they could suffer from an XSS " "attack." msgstr "" "此外,如果开发人员依赖于 ``is_safe_url()`` 来提供安全的重定向目标,并将这样" "的 URL 放入链接中,他们可能会受到 XSS 攻击的影响。" msgid "" "CVE-2017-7234: Open redirect vulnerability in ``django.views.static.serve()``" msgstr "CVE-2017-7234: ``django.views.static.serve()`` 中的开放重定向漏洞" msgid "" "A maliciously crafted URL to a Django site using the :func:`~django.views." "static.serve` view could redirect to any other domain. The view no longer " "does any redirects as they don't provide any known, useful functionality." msgstr "" "一个恶意构建的 URL 到一个使用 :func:`~django.views.static.serve` 视图的 " "Django 站点可能会重定向到任何其他域。该视图不再进行任何重定向,因为它们不提供" "任何已知的有用功能。" msgid "" "Note, however, that this view has always carried a warning that it is not " "hardened for production use and should be used only as a development aid." msgstr "" "注意,然而,这个视图一直带有警告,即它没有经过生产环境的强化,只应作为开发辅" "助工具使用。" msgid "" "Made admin's ``RelatedFieldWidgetWrapper`` use the wrapped widget's " "``value_omitted_from_data()`` method (:ticket:`27905`)." msgstr "" "使管理员的 ``RelatedFieldWidgetWrapper`` 使用被包装小部件的 " "``value_omitted_from_data()`` 方法 (:ticket:`27905`)。" msgid "" "Fixed model form ``default`` fallback for ``SelectMultiple`` (:ticket:" "`27993`)." msgstr "" "修复了模型表单中 ``SelectMultiple`` 的 ``default`` 回退 (:ticket:`27993`)。" msgid "Django 1.10.8 release notes" msgstr "Django 1.10.8 版本发行说明" msgid "*September 5, 2017*" msgstr "*2017 年 9 月 5 日*" msgid "Django 1.10.8 fixes a security issue in 1.10.7." msgstr "Django 1.10.8 修复了 1.10.7 中的一个安全问题。" msgid "" "CVE-2017-12794: Possible XSS in traceback section of technical 500 debug page" msgstr "CVE-2017-12794 :技术性 500 调试页面的追踪部分可能存在 XSS 漏洞" msgid "" "In older versions, HTML autoescaping was disabled in a portion of the " "template for the technical 500 debug page. Given the right circumstances, " "this allowed a cross-site scripting attack. This vulnerability shouldn't " "affect most production sites since you shouldn't run with ``DEBUG = True`` " "(which makes this page accessible) in your production settings." msgstr "" "在旧版本中,在技术性的 500 调试页面模板的一部分中禁用了 HTML 自动转义。在正确" "的情况下,这可能导致跨站点脚本攻击。这个漏洞不应影响大多数生产站点,因为你不" "应该在生产设置中运行 ``DEBUG = True`` (这使得这个页面可访问)。" msgid "Django 1.11 release notes" msgstr "Django 1.11 版本发行说明" msgid "Welcome to Django 1.11!" msgstr "欢迎来到 Django 1.11 版本!" msgid "" "These release notes cover the :ref:`new features `, as well " "as some :ref:`backwards incompatible changes ` " "you'll want to be aware of when upgrading from Django 1.10 or older " "versions. We've :ref:`begun the deprecation process for some features " "`." msgstr "" "这些发布说明涵盖了 :ref:`新功能 `,以及一些 :ref:`不兼容变更 " "`,当您从 Django 1.10 或更早版本升级时,您需要注" "意。我们已经 :ref:`开始了一些功能的弃用过程 `。" msgid "" "Django 1.11 is designated as a :term:`long-term support release `. It will receive security updates for at least three years " "after its release. Support for the previous LTS, Django 1.8, will end in " "April 2018." msgstr "" "Django 1.11 被指定为 :term:`长期支持版本 `。它将在" "发布后至少三年内接收安全更新。对于之前的 LTS 版本 Django 1.8,支持将于 2018 " "年 4 月结束。" msgid "" "Django 1.11 requires Python 2.7, 3.4, 3.5, 3.6, or 3.7 (as of 1.11.17). We " "**highly recommend** and only officially support the latest release of each " "series." msgstr "" "Django 1.11 需要 Python 2.7、3.4、3.5、3.6 或 3.7(截止到 1.11.17 版本)。我" "们* *强烈建议** 并且只正式支持每个系列的最新版本。" msgid "" "The Django 1.11.x series is the last to support Python 2. The next major " "release, Django 2.0, will only support Python 3.4+." msgstr "" "Django 1.11.x 系列是支持 Python 2 的最后一个版本。下一个主要版本,Django " "2.0,将仅支持 Python 3.4+。" msgid "Deprecating warnings are no longer loud by default" msgstr "弃用警告默认不再大声发出" msgid "" "Unlike older versions of Django, Django's own deprecation warnings are no " "longer displayed by default. This is consistent with Python's default " "behavior." msgstr "" "与旧版本的 Django 不同,Django 自身的弃用警告默认不再显示。这与 Python 的默认" "行为一致。" msgid "" "This change allows third-party apps to support both Django 1.11 LTS and " "Django 1.8 LTS without having to add code to avoid deprecation warnings." msgstr "" "此更改允许第三方应用在不添加用于避免弃用警告的代码的情况下同时支持 Django " "1.11 LTS 和 Django 1.8 LTS 。" msgid "" "Following the release of Django 2.0, we suggest that third-party app authors " "drop support for all versions of Django prior to 1.11. At that time, you " "should be able run your package's tests using ``python -Wd`` so that " "deprecation warnings do appear. After making the deprecation warning fixes, " "your app should be compatible with Django 2.0." msgstr "" "在发布 Django 2.0 后,我们建议第三方应用的作者停止支持所有在 1.11 之前的 " "Django 版本。在那时,您应该能够使用 ``python -Wd`` 运行您包的测试,以确保弃用" "警告出现。在修复弃用警告后,您的应用应该与 Django 2.0 兼容。" msgid "What's new in Django 1.11" msgstr "Django 1.11 新特性" msgid "Class-based model indexes" msgstr "基于类的模型索引" msgid "" "The new :mod:`django.db.models.indexes` module contains classes which ease " "creating database indexes. Indexes are added to models using the :attr:`Meta." "indexes ` option." msgstr "" "新的 :mod:`django.db.models.indexes` 模块包含了用于简化创建数据库索引的类。索" "引可以通过在模型中使用 :attr:`Meta.indexes ` 选项来添加。" msgid "" "The :class:`~django.db.models.Index` class creates a b-tree index, as if you " "used :attr:`~django.db.models.Field.db_index` on the model field or :attr:" "`~django.db.models.Options.index_together` on the model ``Meta`` class. It " "can be subclassed to support different index types, such as :class:`~django." "contrib.postgres.indexes.GinIndex`. It also allows defining the order (ASC/" "DESC) for the columns of the index." msgstr "" ":class:`~django.db.models.Index` 类创建一个 b-tree 索引,就像您在模型字段上使" "用 :attr:`~django.db.models.Field.db_index` 或在模型的 ``Meta`` 类上使用 :" "attr:`~django.db.models.Options.index_together` 一样。它可以被子类化以支持不" "同的索引类型,比如 :class:`~django.contrib.postgres.indexes.GinIndex`。它还允" "许定义索引列的顺序(ASC/DESC)。" msgid "Template-based widget rendering" msgstr "基于模板的小部件渲染" msgid "" "To ease customizing widgets, form widget rendering is now done using the " "template system rather than in Python. See :doc:`/ref/forms/renderers`." msgstr "" "为了方便定制小部件,现在表单小部件的渲染是使用模板系统而不是在 Python 中进行" "的。请参阅 :doc:`/ref/forms/renderers`。" msgid "" "You may need to adjust any custom widgets that you've written for a few :ref:" "`backwards incompatible changes `." msgstr "" "你可能需要调整你编写的任何自定义小部件,以适应一些 :ref:`不兼容变更 " "`。" msgid "``Subquery`` expressions" msgstr "``Subquery`` 表达式" msgid "" "The new :class:`~django.db.models.Subquery` and :class:`~django.db.models." "Exists` database expressions allow creating explicit subqueries. Subqueries " "may refer to fields from the outer queryset using the :class:`~django.db." "models.OuterRef` class." msgstr "" "新的 :class:`~django.db.models.Subquery` 和 :class:`~django.db.models." "Exists` 数据库表达式允许创建明确的子查询。子查询可以使用 :class:`~django.db." "models.OuterRef` 类引用来自外部查询集的字段。" msgid "" ":attr:`.ModelAdmin.date_hierarchy` can now reference fields across relations." msgstr ":attr:`.ModelAdmin.date_hierarchy` 现在可以引用跨关联的字段。" msgid "" "The new :meth:`ModelAdmin.get_exclude() ` hook allows specifying the exclude fields based on the request " "or model instance." msgstr "" "新的 :meth:`ModelAdmin.get_exclude() ` 钩子允许根据请求或模型实例指定要排除的字段。" msgid "" "The ``popup_response.html`` template can now be overridden per app, per " "model, or by setting the :attr:`.ModelAdmin.popup_response_template` " "attribute." msgstr "" "``popup_response.html`` 模板现在可以按照每个应用程序、每个模型或通过设置 :" "attr:`.ModelAdmin.popup_response_template` 属性来进行覆盖。" msgid "" "The default iteration count for the PBKDF2 password hasher is increased by " "20%." msgstr "PBKDF2 密码哈希器的默认迭代次数增加了 20 %。" msgid "" "The :class:`~django.contrib.auth.views.LoginView` and :class:`~django." "contrib.auth.views.LogoutView` class-based views supersede the deprecated " "``login()`` and ``logout()`` function-based views." msgstr "" ":class:`~django.contrib.auth.views.LoginView` 和 :class:`~django.contrib." "auth.views.LogoutView` 基于类的视图替代了已弃用的 ``login()`` 和 " "``logout()`` 基于函数的视图。" msgid "" "The :class:`~django.contrib.auth.views.PasswordChangeView`, :class:`~django." "contrib.auth.views.PasswordChangeDoneView`, :class:`~django.contrib.auth." "views.PasswordResetView`, :class:`~django.contrib.auth.views." "PasswordResetDoneView`, :class:`~django.contrib.auth.views." "PasswordResetConfirmView`, and :class:`~django.contrib.auth.views." "PasswordResetCompleteView` class-based views supersede the deprecated " "``password_change()``, ``password_change_done()``, ``password_reset()``, " "``password_reset_done()``, ``password_reset_confirm()``, and " "``password_reset_complete()`` function-based views." msgstr "" ":class:`~django.contrib.auth.views.PasswordChangeView`、:class:`~django." "contrib.auth.views.PasswordChangeDoneView`、:class:`~django.contrib.auth." "views.PasswordResetView`、:class:`~django.contrib.auth.views." "PasswordResetDoneView`、:class:`~django.contrib.auth.views." "PasswordResetConfirmView` 和 :class:`~django.contrib.auth.views." "PasswordResetCompleteView` 基于类的视图替代了已弃用的 ``password_change()``, " "``password_change_done()``, ``password_reset()``, ``password_reset_done()``, " "``password_reset_confirm()``, 和 ``password_reset_complete()`` 基于函数的视" "图。" msgid "" "The new ``post_reset_login`` attribute for :class:`~django.contrib.auth." "views.PasswordResetConfirmView` allows automatically logging in a user after " "a successful password reset. If you have multiple " "``AUTHENTICATION_BACKENDS`` configured, use the ``post_reset_login_backend`` " "attribute to choose which one to use." msgstr "" ":class:`~django.contrib.auth.views.PasswordResetConfirmView` 的新属性 " "``post_reset_login`` 允许在成功重置密码后自动登录用户。如果配置了多个 " "``AUTHENTICATION_BACKENDS``,可以使用 ``post_reset_login_backend`` 属性选择要" "使用的后端。" msgid "" "To avoid the possibility of leaking a password reset token via the HTTP " "Referer header (for example, if the reset page includes a reference to CSS " "or JavaScript hosted on another domain), the :class:`~django.contrib.auth." "views.PasswordResetConfirmView` (but not the deprecated " "``password_reset_confirm()`` function-based view) stores the token in a " "session and redirects to itself to present the password change form to the " "user without the token in the URL." msgstr "" "为了避免通过 HTTP Referer 标头泄露密码重置令牌的可能性(例如,如果重置页面包" "含对托管在另一个域上的 CSS 或 JavaScript 的引用),:class:`~django.contrib." "auth.views.PasswordResetConfirmView` (但不是已弃用的 " "``password_reset_confirm()`` 基于函数的视图)将令牌存储在会话中,并重定向到自" "身,以向用户呈现不带令牌的 URL 的密码更改表单。" msgid "" ":func:`~django.contrib.auth.update_session_auth_hash` now rotates the " "session key to allow a password change to invalidate stolen session cookies." msgstr "" ":func:`~django.contrib.auth.update_session_auth_hash` 现在会旋转会话密钥,以" "允许密码更改来使被窃取的会话 Cookie 失效。" msgid "" "The new ``success_url_allowed_hosts`` attribute for :class:`~django.contrib." "auth.views.LoginView` and :class:`~django.contrib.auth.views.LogoutView` " "allows specifying a set of hosts that are safe for redirecting after login " "and logout." msgstr "" ":class:`~django.contrib.auth.views.LoginView` 和 :class:`~django.contrib." "auth.views.LogoutView` 的新属性 ``success_url_allowed_hosts`` 允许指定一组安" "全的主机,用于在登录和注销后进行重定向。" msgid "" "Added password validators ``help_text`` to :class:`~django.contrib.auth." "forms.UserCreationForm`." msgstr "" "已添加密码验证器的 ``help_text`` 到 :class:`~django.contrib.auth.forms." "UserCreationForm`。" msgid "" "The ``HttpRequest`` is now passed to :func:`~django.contrib.auth." "authenticate` which in turn passes it to the authentication backend if it " "accepts a ``request`` argument." msgstr "" "``HttpRequest`` 现在传递给 :func:`~django.contrib.auth.authenticate`,如果身" "份验证后端接受 ``request`` 参数,则它将传递给身份验证后端。" msgid "" "The :func:`~django.contrib.auth.signals.user_login_failed` signal now " "receives a ``request`` argument." msgstr "" ":func:`~django.contrib.auth.signals.user_login_failed` 信号现在接收一个 " "``request`` 参数。" msgid "" ":class:`~django.contrib.auth.forms.PasswordResetForm` supports custom user " "models that use an email field named something other than ``'email'``. Set :" "attr:`CustomUser.EMAIL_FIELD ` to the name of the field." msgstr "" ":class:`~django.contrib.auth.forms.PasswordResetForm` 支持自定义用户模型,该" "模型使用名称不是 ``'email'`` 的电子邮件字段。将 :attr:`CustomUser." "EMAIL_FIELD ` 设置为字段的" "名称。" msgid "" ":func:`~django.contrib.auth.get_user_model` can now be called at import " "time, even in modules that define models." msgstr "" ":func:`~django.contrib.auth.get_user_model` 现在可以在导入时调用,即使在定义" "模型的模块中也可以。" msgid ":mod:`django.contrib.contenttypes`" msgstr ":mod:`django.contrib.contenttypes`" msgid "" "When stale content types are detected in the :djadmin:" "`remove_stale_contenttypes` command, there's now a list of related objects " "such as ``auth.Permission``\\s that will also be deleted. Previously, only " "the content types were listed (and this prompt was after ``migrate`` rather " "than in a separate command)." msgstr "" "在 :djadmin:`remove_stale_contenttypes` 命令中,当检测到陈旧的内容类型时,现" "在会列出一系列相关对象,如 ``auth.Permission``,这些对象也将被删除。之前,只" "列出了内容类型(而且此提示是在 ``migrate`` 之后,而不是在一个单独的命令中)。" msgid "" "The new :meth:`.GEOSGeometry.from_gml` and :meth:`.OGRGeometry.from_gml` " "methods allow creating geometries from GML." msgstr "" "新的 :meth:`.GEOSGeometry.from_gml` 和 :meth:`.OGRGeometry.from_gml` 方法允许" "从 GML 创建几何图形。" msgid "Added support for the :lookup:`dwithin` lookup on SpatiaLite." msgstr "在 SpatiaLite 上新增了对 :lookup:`dwithin` 查询的支持。" msgid "" "The :class:`~django.contrib.gis.db.models.functions.Area` function, :class:" "`~django.contrib.gis.db.models.functions.Distance` function, and distance " "lookups now work with geodetic coordinates on SpatiaLite." msgstr "" ":class:`~django.contrib.gis.db.models.functions.Area` 函数、:class:`~django." "contrib.gis.db.models.functions.Distance` 函数以及距离查询现在在 SpatiaLite " "上支持大地坐标。" msgid "" "The OpenLayers-based form widgets now use ``OpenLayers.js`` from ``https://" "cdnjs.cloudflare.com`` which is more suitable for production use than the " "old ``https://openlayers.org/`` source. They are also updated to use " "OpenLayers 3." msgstr "" "基于 OpenLayers 的表单小部件现在使用来自 ``https://cdnjs.cloudflare.com`` 的 " "``OpenLayers.js``,这比旧的 ``https://openlayers.org/`` 源更适合生产使用。它" "们还更新为使用 OpenLayers 3。" msgid "PostGIS migrations can now change field dimensions." msgstr "PostGIS 迁移现在可以改变字段尺寸。" msgid "" "Added the ability to pass the ``size``, ``shape``, and ``offset`` parameters " "when creating :class:`~django.contrib.gis.gdal.GDALRaster` objects." msgstr "" "现在可以在创建 :class:`~django.contrib.gis.gdal.GDALRaster` 对象时传递 " "``size``、``shape`` 和 ``offset`` 参数。" msgid "" "Added SpatiaLite support for the :class:`~django.contrib.gis.db.models." "functions.IsValid` function, :class:`~django.contrib.gis.db.models.functions." "MakeValid` function, and :lookup:`isvalid` lookup." msgstr "" "新增了对 :class:`~django.contrib.gis.db.models.functions.IsValid` 函数、:" "class:`~django.contrib.gis.db.models.functions.MakeValid` 函数以及 :lookup:" "`isvalid` 查询的 SpatiaLite 支持。" msgid "" "Added Oracle support for the :class:`~django.contrib.gis.db.models.functions." "AsGML` function, :class:`~django.contrib.gis.db.models.functions." "BoundingCircle` function, :class:`~django.contrib.gis.db.models.functions." "IsValid` function, and :lookup:`isvalid` lookup." msgstr "" "新增了对 Oracle 数据库的支持,包括 :class:`~django.contrib.gis.db.models." "functions.AsGML` 函数、:class:`~django.contrib.gis.db.models.functions." "BoundingCircle` 函数、:class:`~django.contrib.gis.db.models.functions." "IsValid` 函数以及 :lookup:`isvalid` 查询。" msgid "" "The new ``distinct`` argument for :class:`~django.contrib.postgres." "aggregates.StringAgg` determines if concatenated values will be distinct." msgstr "" ":class:`~django.contrib.postgres.aggregates.StringAgg` 的新参数 ``distinct`` " "决定了连接的值是否要去重。" msgid "" "The new :class:`~django.contrib.postgres.indexes.GinIndex` and :class:" "`~django.contrib.postgres.indexes.BrinIndex` classes allow creating ``GIN`` " "and ``BRIN`` indexes in the database." msgstr "" "新的 :class:`~django.contrib.postgres.indexes.GinIndex` 和 :class:`~django." "contrib.postgres.indexes.BrinIndex` 类允许在数据库中创建 ``GIN`` 和 ``BRIN`` " "索引。" msgid "" "``django.contrib.postgres.fields.JSONField`` accepts a new ``encoder`` " "parameter to specify a custom class to encode data types not supported by " "the standard encoder." msgstr "" "``django.contrib.postgres.fields.JSONField`` 接受一个新的参数 ``encoder``,用" "于指定自定义类以编码不受标准编码器支持的数据类型。" msgid "" "The new ``CIText`` mixin and :class:`~django.contrib.postgres.operations." "CITextExtension` migration operation allow using PostgreSQL's ``citext`` " "extension for case-insensitive lookups. Three fields are provided: " "``CICharField``, ``CIEmailField``, and ``CITextField``." msgstr "" "新的 ``CIText`` 混合类和 :class:`~django.contrib.postgres.operations." "CITextExtension` 迁移操作允许在 PostgreSQL 中使用 ``citext`` 扩展来进行不区分" "大小写的查找。提供了三个字段:``CICharField``、``CIEmailField`` 和 " "``CITextField``。" msgid "" "The new :class:`~django.contrib.postgres.aggregates.JSONBAgg` allows " "aggregating values as a JSON array." msgstr "" "新的 :class:`~django.contrib.postgres.aggregates.JSONBAgg` 允许将值聚合为 " "JSON 数组。" msgid "" "The :class:`~django.contrib.postgres.fields.HStoreField` (model field) and :" "class:`~django.contrib.postgres.forms.HStoreField` (form field) allow " "storing null values." msgstr "" ":class:`~django.contrib.postgres.fields.HStoreField` (模型字段)和 :class:" "`~django.contrib.postgres.forms.HStoreField` (表单字段)允许存储空值。" msgid "" "Memcached backends now pass the contents of :setting:`OPTIONS ` as keyword arguments to the client constructors, allowing for more " "advanced control of client behavior. See the :ref:`cache arguments " "` documentation for examples." msgstr "" "Memcached 后端现在将 :setting:`OPTIONS ` 的内容作为关键字参数" "传递给客户端构造函数,允许更高级的客户端行为控制。请参阅 :ref:`cache " "arguments ` 文档以获取示例。" msgid "" "Memcached backends now allow defining multiple servers as a comma-delimited " "string in :setting:`LOCATION `, for convenience with third-" "party services that use such strings in environment variables." msgstr "" "Memcached 后端现在允许在 :setting:`LOCATION ` 中定义多个服务" "器,使用逗号分隔的字符串,以方便处理使用这种字符串的环境变量的第三方服务。" msgid "" "Added the :setting:`CSRF_USE_SESSIONS` setting to allow storing the CSRF " "token in the user's session rather than in a cookie." msgstr "" "新增了 :setting:`CSRF_USE_SESSIONS` 设置,允许将 CSRF 令牌存储在用户的会话" "中,而不是在 cookie 中。" msgid "" "Added the ``skip_locked`` argument to :meth:`.QuerySet.select_for_update()` " "on PostgreSQL 9.5+ and Oracle to execute queries with ``FOR UPDATE SKIP " "LOCKED``." msgstr "" "在 PostgreSQL 9.5+ 和 Oracle 上,新增了 ``skip_locked`` 参数,用于执行带有 " "``FOR UPDATE SKIP LOCKED`` 的查询,可通过 :meth:`.QuerySet." "select_for_update()` 使用。" msgid "" "Added the :setting:`TEST['TEMPLATE'] ` setting to let " "PostgreSQL users specify a template for creating the test database." msgstr "" "新增了 :setting:`TEST['TEMPLATE'] ` 设置,允许 PostgreSQL 用户" "指定用于创建测试数据库的模板。" msgid "" ":meth:`.QuerySet.iterator()` now uses `server-side cursors`_ on PostgreSQL. " "This feature transfers some of the worker memory load (used to hold query " "results) to the database and might increase database memory usage." msgstr "" ":meth:`.QuerySet.iterator()` 现在在 PostgreSQL 上使用 `server-side " "cursors`_。这个功能将一些用于保存查询结果的工作内存负载转移到数据库,可能会增" "加数据库的内存使用量。" msgid "" "Added MySQL support for the ``'isolation_level'`` option in :setting:" "`OPTIONS` to allow specifying the :ref:`transaction isolation level `. To avoid possible data loss, it's recommended to switch " "from MySQL's default level, repeatable read, to read committed." msgstr "" "新增了对在 :setting:`OPTIONS` 中使用 ``'isolation_level'`` 选项的 MySQL 支" "持,允许指定 :ref:`事务隔离级别 `。为了避免可能的数据" "丢失,建议从 MySQL 的默认级别 repeatable read 切换到 read committed。" msgid "Added support for ``cx_Oracle`` 5.3." msgstr "新增了对 ``cx_Oracle`` 5.3 的支持。" msgid "Email" msgstr "电子邮件" msgid "" "Added the :setting:`EMAIL_USE_LOCALTIME` setting to allow sending SMTP date " "headers in the local time zone rather than in UTC." msgstr "" "新增了 :setting:`EMAIL_USE_LOCALTIME` 设置,允许将 SMTP 日期标头发送到本地时" "区,而不是 UTC。" msgid "" "``EmailMessage.attach()`` and ``attach_file()`` now fall back to MIME type :" "mimetype:`application/octet-stream` when binary content that can't be " "decoded as UTF-8 is specified for a :mimetype:`text/*` attachment." msgstr "" "``EmailMessage.attach()`` 和 ``attach_file()`` 现在在为 :mimetype:`text/*` 附" "件指定无法解码为 UTF-8 的二进制内容时,会回退到 MIME 类型 :mimetype:" "`application/octet-stream`。" msgid "" "To make it wrappable by :class:`io.TextIOWrapper`, :class:`~django.core." "files.File` now has the ``readable()``, ``writable()``, and ``seekable()`` " "methods." msgstr "" "为了能够被 :class:`io.TextIOWrapper` 包装,:class:`~django.core.files.File` " "现在具有 ``readable()``、``writable()`` 和 ``seekable()`` 方法。" msgid "" "The new ``empty_value`` attribute on :class:`~django.forms.CharField`, :" "class:`~django.forms.EmailField`, :class:`~django.forms.RegexField`, :class:" "`~django.forms.SlugField`, and :class:`~django.forms.URLField` allows " "specifying the Python value to use to represent \"empty\"." msgstr "" "在 :class:`~django.forms.CharField`、:class:`~django.forms.EmailField`、:" "class:`~django.forms.RegexField`、:class:`~django.forms.SlugField` 和 :class:" "`~django.forms.URLField` 上新增了 ``empty_value`` 属性,允许指定表示 \"空\" " "的 Python 值。" msgid "" "The new :meth:`Form.get_initial_for_field() ` method returns initial data for a form field." msgstr "" "新的 :meth:`Form.get_initial_for_field() ` 方法返回表单字段的初始数据。" msgid "" "Number formatting and the :setting:`NUMBER_GROUPING` setting support non-" "uniform digit grouping." msgstr "数字格式化和 :setting:`NUMBER_GROUPING` 设置支持非均匀的数字分组。" msgid "" "The new :option:`loaddata --exclude` option allows excluding models and apps " "while loading data from fixtures." msgstr "" "新的 :option:`loaddata --exclude` 选项允许在从 fixture 加载数据时排除模型和应" "用程序。" msgid "" "The new :option:`diffsettings --default` option allows specifying a settings " "module other than Django's default settings to compare against." msgstr "" "新的 :option:`diffsettings --default` 选项允许指定与 Django 默认设置进行比较" "的设置模块。" msgid "" "``app_label``\\s arguments now limit the :option:`showmigrations --plan` " "output." msgstr "``app_label`` 参数现在限制了 :option:`showmigrations --plan` 输出。" msgid "Added support for serialization of ``uuid.UUID`` objects." msgstr "新增了对 ``uuid.UUID`` 对象的序列化支持。" msgid "" "Added support for callable values in the ``defaults`` argument of :meth:" "`QuerySet.update_or_create() ` and :meth:`~django.db.models.query.QuerySet." "get_or_create`." msgstr "" "在 :meth:`QuerySet.update_or_create() ` 和 :meth:`~django.db.models.query.QuerySet.get_or_create` " "的 ``defaults`` 参数中新增了对可调用值的支持。" msgid "" ":class:`~django.db.models.ImageField` now has a default :data:`~django.core." "validators.validate_image_file_extension` validator. (This validator moved " "to the form field in :doc:`Django 1.11.2 <1.11.2>`.)" msgstr "" ":class:`~django.db.models.ImageField` 现在具有默认的 :data:`~django.core." "validators.validate_image_file_extension` 验证器。(此验证器在 :doc:`Django " "1.11.2 <1.11.2>` 中移至表单字段。)" msgid "" "Added support for time truncation to :class:`~django.db.models.functions." "Trunc` functions." msgstr ":class:`~django.db.models.functions.Trunc` 函数现在支持时间截断。" msgid "" "Added the :class:`~django.db.models.functions.ExtractWeek` function to " "extract the week from :class:`~django.db.models.DateField` and :class:" "`~django.db.models.DateTimeField` and exposed it through the :lookup:`week` " "lookup." msgstr "" "新增了 :class:`~django.db.models.functions.ExtractWeek` 函数,用于从 :class:" "`~django.db.models.DateField` 和 :class:`~django.db.models.DateTimeField` 中" "提取周,并通过 :lookup:`week` 查询公开。" msgid "" "Added the :class:`~django.db.models.functions.TruncTime` function to " "truncate :class:`~django.db.models.DateTimeField` to its time component and " "exposed it through the :lookup:`time` lookup." msgstr "" "新增了 :class:`~django.db.models.functions.TruncTime` 函数,用于将 :class:" "`~django.db.models.DateTimeField` 截断到其时间组件,并通过 :lookup:`time` 查" "询公开。" msgid "" "Added support for expressions in :meth:`.QuerySet.values` and :meth:`~." "QuerySet.values_list`." msgstr "" "在 :meth:`.QuerySet.values` 和 :meth:`~.QuerySet.values_list` 中添加了对表达" "式的支持。" msgid "" "Added support for query expressions on lookups that take multiple arguments, " "such as ``range``." msgstr "对于接受多个参数的查询,如 ``range``,新增了对查询表达式的支持。" msgid "" "You can now use the ``unique=True`` option with :class:`~django.db.models." "FileField`." msgstr "" "现在可以在 :class:`~django.db.models.FileField` 上使用 ``unique=True`` 选项。" msgid "" "Added the ``nulls_first`` and ``nulls_last`` parameters to :class:" "`Expression.asc() ` and :meth:`~django.db." "models.Expression.desc` to control the ordering of null values." msgstr "" "新增了 :class:`Expression.asc() ` 和 :meth:" "`~django.db.models.Expression.desc` 的 ``nulls_first`` 和 ``nulls_last`` 参" "数,用于控制空值的排序顺序。" msgid "" "The new ``F`` expression ``bitleftshift()`` and ``bitrightshift()`` methods " "allow :ref:`bitwise shift operations `." msgstr "" "新的 ``F`` 表达式中的 ``bitleftshift()`` 和 ``bitrightshift()`` 方法允许进" "行 :ref:`位移位操作 `。" msgid "" "Added :meth:`.QuerySet.union`, :meth:`~.QuerySet.intersection`, and :meth:`~." "QuerySet.difference`." msgstr "" "新增了 :meth:`.QuerySet.union`、:meth:`~.QuerySet.intersection` 和 :meth:`~." "QuerySet.difference` 方法。" msgid "Added :meth:`QueryDict.fromkeys() `." msgstr "" "新增了 :meth:`QueryDict.fromkeys() ` 方法。" msgid "" ":class:`~django.middleware.common.CommonMiddleware` now sets the ``Content-" "Length`` response header for non-streaming responses." msgstr "" ":class:`~django.middleware.common.CommonMiddleware` 现在为非流式响应设置 " "``Content-Length`` 响应头。" msgid "" "Added the :setting:`SECURE_HSTS_PRELOAD` setting to allow appending the " "``preload`` directive to the ``Strict-Transport-Security`` header." msgstr "" "新增了 :setting:`SECURE_HSTS_PRELOAD` 设置,允许将 ``preload`` 指令附加到 " "``Strict-Transport-Security`` 头部。" msgid "" ":class:`~django.middleware.http.ConditionalGetMiddleware` now adds the " "``ETag`` header to responses." msgstr "" ":class:`~django.middleware.http.ConditionalGetMiddleware` 现在将 ``ETag`` 头" "部添加到响应中。" msgid "" "The new ``django.core.serializers.base.Serializer.stream_class`` attribute " "allows subclasses to customize the default stream." msgstr "" "新的 ``django.core.serializers.base.Serializer.stream_class`` 属性允许子类自" "定义默认流。" msgid "" "The encoder used by the :ref:`JSON serializer ` " "can now be customized by passing a ``cls`` keyword argument to the " "``serializers.serialize()`` function." msgstr "" "可以通过向 ``serializers.serialize()`` 函数传递一个 ``cls`` 关键字参数来自定" "义 :ref:`JSON 序列化器 ` 使用的编码器。" msgid "" ":class:`~django.core.serializers.json.DjangoJSONEncoder` now serializes :" "class:`~datetime.timedelta` objects (used by :class:`~django.db.models." "DurationField`)." msgstr "" ":class:`~django.core.serializers.json.DjangoJSONEncoder` 现在可以序列化 :" "class:`~datetime.timedelta` 对象(被 :class:`~django.db.models." "DurationField` 使用)。" msgid "" ":meth:`~django.utils.safestring.mark_safe` can now be used as a decorator." msgstr "现在可以将 :meth:`~django.utils.safestring.mark_safe` 用作装饰器。" msgid "" "The :class:`~django.template.backends.jinja2.Jinja2` template backend now " "supports context processors by setting the ``'context_processors'`` option " "in :setting:`OPTIONS `." msgstr "" ":class:`~django.template.backends.jinja2.Jinja2` 模板后端现在支持通过在 :" "setting:`OPTIONS ` 中设置 ``'context_processors'`` 选项来" "配置上下文处理器。" msgid "" "The :ttag:`regroup` tag now returns ``namedtuple``\\s instead of " "dictionaries so you can unpack the group object directly in a loop, e.g. " "``{% for grouper, list in regrouped %}``." msgstr "" ":ttag:`regroup` 标签现在返回 ``namedtuple`` 而不是字典,因此你可以在循环中直" "接解包组对象,例如 ``{% for grouper, list in regrouped %}``。" msgid "" "Added a :ttag:`resetcycle` template tag to allow resetting the sequence of " "the :ttag:`cycle` template tag." msgstr "" "新增了 :ttag:`resetcycle` 模板标签,允许重置 :ttag:`cycle` 模板标签的序列。" msgid "" "You can now specify specific directories for a particular :class:`filesystem." "Loader `." msgstr "" "现在可以为特定的 :class:`filesystem.Loader ` 指定特定的目录。" msgid "" "Added :meth:`.DiscoverRunner.get_test_runner_kwargs` to allow customizing " "the keyword arguments passed to the test runner." msgstr "" "新增了 :meth:`.DiscoverRunner.get_test_runner_kwargs` 方法,允许自定义传递给" "测试运行器的关键字参数。" msgid "" "Added the :option:`test --debug-mode` option to help troubleshoot test " "failures by setting the :setting:`DEBUG` setting to ``True``." msgstr "" "新增了 :option:`test --debug-mode` 选项,通过将 :setting:`DEBUG` 设置为 " "``True`` 来帮助排查测试失败。" msgid "" "The new :func:`django.test.utils.setup_databases` (moved from ``django.test." "runner``) and :func:`~django.test.utils.teardown_databases` functions make " "it easier to build custom test runners." msgstr "" "新的 :func:`django.test.utils.setup_databases` (从 ``django.test.runner`` 移" "动过来)和 :func:`~django.test.utils.teardown_databases` 函数使构建自定义测试" "运行器更加容易。" msgid "" "Added support for :meth:`python:unittest.TestCase.subTest`’s when using the :" "option:`test --parallel` option." msgstr "" "在使用 :option:`test --parallel` 选项时,新增了对 :meth:`python:unittest." "TestCase.subTest` 的支持。" msgid "" "``DiscoverRunner`` now runs the system checks at the start of a test run. " "Override the :meth:`.DiscoverRunner.run_checks` method if you want to " "disable that." msgstr "" "``DiscoverRunner`` 现在在测试运行开始时运行系统检查。如果要禁用此功能,请覆" "盖 :meth:`.DiscoverRunner.run_checks` 方法。" msgid "" "Added :class:`~django.core.validators.FileExtensionValidator` to validate " "file extensions and :data:`~django.core.validators." "validate_image_file_extension` to validate image files." msgstr "" "新增了 :class:`~django.core.validators.FileExtensionValidator` 以验证文件扩展" "名,以及 :data:`~django.core.validators.validate_image_file_extension` 以验证" "图像文件。" msgid "Backwards incompatible changes in 1.11" msgstr "1.11 中的向后不兼容更改" msgid "" "To simplify the codebase and because it's easier to install than when " "``contrib.gis`` was first released, :ref:`gdalbuild` is now a required " "dependency for GeoDjango. In older versions, it's only required for SQLite." msgstr "" "为了简化代码库并且因为现在安装起来更容易(相对于最初发布 ``contrib.gis`` 时的" "情况),现在在 GeoDjango 中需要 :ref:`gdalbuild` 作为依赖。在旧版本中,它只" "对 SQLite 有要求。" msgid "" "``contrib.gis.maps`` is removed as it interfaces with a retired version of " "the Google Maps API and seems to be unmaintained. If you're using it, :" "ticket:`let us know <14284>`." msgstr "" "``contrib.gis.maps`` 已被移除,因为它与已退役的 Google Maps API 版本进行交" "互,似乎没有维护。如果您正在使用它,请 :ticket:`告诉我们 <14284>`。" msgid "The ``GEOSGeometry`` equality operator now also compares SRID." msgstr "``GEOSGeometry`` 的等号运算符现在也会比较 SRID。" msgid "" "The OpenLayers-based form widgets now use OpenLayers 3, and the ``gis/" "openlayers.html`` and ``gis/openlayers-osm.html`` templates have been " "updated. Check your project if you subclass these widgets or extend the " "templates. Also, the new widgets work a bit differently than the old ones. " "Instead of using a toolbar in the widget, you click to draw, click and drag " "to move the map, and click and drag a point/vertex/corner to move it." msgstr "" "基于 OpenLayers 的表单小部件现在使用 OpenLayers 3,同时更新了 ``gis/" "openlayers.html`` 和 ``gis/openlayers-osm.html`` 模板。如果您对这些小部件进行" "子类化或扩展模板,请检查您的项目。此外,新的小部件与旧的小部件有一些不同。不" "再使用小部件中的工具栏,而是点击以绘制,点击并拖动以移动地图,以及点击并拖动" "一个点/顶点/角来移动它。" msgid "Support for SpatiaLite < 4.0 is dropped." msgstr "不再支持 SpatiaLite < 4.0 。" msgid "Support for GDAL 1.7 and 1.8 is dropped." msgstr "不再支持 GDAL 1.7 和 1.8 。" msgid "" "The widgets in ``contrib.gis.forms.widgets`` and the admin's " "``OpenLayersWidget`` use the :doc:`form rendering API ` rather than ``loader.render_to_string()``. If you're using a " "custom widget template, you'll need to be sure your form renderer can locate " "it. For example, you could use the :class:`~django.forms.renderers." "TemplatesSetting` renderer." msgstr "" "``contrib.gis.forms.widgets`` 中的小部件和管理员的 ``OpenLayersWidget`` 现在" "使用 :doc:`表单渲染 API ` 而不是 ``loader." "render_to_string()``。如果您使用自定义小部件模板,您需要确保您的表单渲染器可" "以找到它。例如,您可以使用 :class:`~django.forms.renderers.TemplatesSetting` " "渲染器。" msgid "" "``collectstatic`` may now fail during post-processing when using a hashed " "static files storage if a reference loop exists (e.g. ``'foo.css'`` " "references ``'bar.css'`` which itself references ``'foo.css'``) or if the " "chain of files referencing other files is too deep to resolve in several " "passes. In the latter case, increase the number of passes using :attr:`." "ManifestStaticFilesStorage.max_post_process_passes`." msgstr "" "当使用散列的静态文件存储时,如果存在引用循环(例如,``'foo.css'`` 引用 " "``'bar.css'``,而 ``'bar.css'`` 又引用 ``'foo.css'``),或者如果引用其他文件" "的文件链过深,无法在多次传递中解析,那么 ``collectstatic`` 在后处理期间可能会" "失败。在后一种情况下,可以通过 :attr:`.ManifestStaticFilesStorage." "max_post_process_passes` 增加传递次数。" msgid "" "When using ``ManifestStaticFilesStorage``, static files not found in the " "manifest at runtime now raise a ``ValueError`` instead of returning an " "unchanged path. You can revert to the old behavior by setting :attr:`." "ManifestStaticFilesStorage.manifest_strict` to ``False``." msgstr "" "当使用 ``ManifestStaticFilesStorage`` 时,运行时未在清单中找到的静态文件现在" "会引发 ``ValueError``,而不是返回不变的路径。您可以通过将 :attr:`." "ManifestStaticFilesStorage.manifest_strict` 设置为 ``False`` 来恢复到旧的行" "为。" msgid "" "This section describes changes that may be needed in third-party database " "backends." msgstr "本节介绍了第三方数据库后端可能需要的更改。" msgid "" "The ``DatabaseOperations.time_trunc_sql()`` method is added to support " "``TimeField`` truncation. It accepts a ``lookup_type`` and ``field_name`` " "arguments and returns the appropriate SQL to truncate the given time field " "``field_name`` to a time object with only the given specificity. The " "``lookup_type`` argument can be either ``'hour'``, ``'minute'``, or " "``'second'``." msgstr "" "新增了 ``DatabaseOperations.time_trunc_sql()`` 方法,以支持 ``TimeField`` 截" "断。它接受一个 ``lookup_type`` 和 ``field_name`` 参数,并返回将给定时间字段 " "``field_name`` 截断为只具有给定精度的时间对象的适当 SQL。``lookup_type`` 参数" "可以是 ``'hour'``、``'minute'`` 或 ``'second'``。" msgid "" "The ``DatabaseOperations.datetime_cast_time_sql()`` method is added to " "support the :lookup:`time` lookup. It accepts a ``field_name`` and " "``tzname`` arguments and returns the SQL necessary to cast a datetime value " "to time value." msgstr "" "新增了 ``DatabaseOperations.datetime_cast_time_sql()`` 方法,以支持 :lookup:" "`time` 查询。它接受一个 ``field_name`` 和 ``tzname`` 参数,并返回将日期时间值" "强制转换为时间值所需的 SQL。" msgid "" "To enable ``FOR UPDATE SKIP LOCKED`` support, set ``DatabaseFeatures." "has_select_for_update_skip_locked = True``." msgstr "" "要启用 ``FOR UPDATE SKIP LOCKED`` 支持,请设置 ``DatabaseFeatures." "has_select_for_update_skip_locked = True``。" msgid "" "The new ``DatabaseFeatures.supports_index_column_ordering`` attribute " "specifies if a database allows defining ordering for columns in indexes. The " "default value is ``True`` and the ``DatabaseIntrospection." "get_constraints()`` method should include an ``'orders'`` key in each of the " "returned dictionaries with a list of ``'ASC'`` and/or ``'DESC'`` values " "corresponding to the ordering of each column in the index." msgstr "" "新的 ``DatabaseFeatures.supports_index_column_ordering`` 属性指定数据库是否允" "许在索引中定义列的排序。默认值为 ``True``,而 ``DatabaseIntrospection." "get_constraints()`` 方法应在每个返回的字典中包含一个 ``'orders'`` 键,该键包" "含一个列表,其中包含与索引中每列的排序对应的 ``'ASC'`` 和/或 ``'DESC'`` 值。" msgid "" ":djadmin:`inspectdb` no longer calls ``DatabaseIntrospection.get_indexes()`` " "which is deprecated. Custom database backends should ensure all types of " "indexes are returned by ``DatabaseIntrospection.get_constraints()``." msgstr "" ":djadmin:`inspectdb` 不再调用已弃用的 ``DatabaseIntrospection." "get_indexes()`` 方法。自定义数据库后端应确保 ``DatabaseIntrospection." "get_constraints()`` 返回所有类型的索引。" msgid "" "Renamed the ``ignores_quoted_identifier_case`` feature to " "``ignores_table_name_case`` to more accurately reflect how it is used." msgstr "" "将 ``ignores_quoted_identifier_case`` 功能的名称更改为 " "``ignores_table_name_case``,以更准确地反映它的使用方式。" msgid "" "The ``name`` keyword argument is added to the ``DatabaseWrapper." "create_cursor(self, name=None)`` method to allow usage of server-side " "cursors on backends that support it." msgstr "" "新增了 ``name`` 关键字参数到 ``DatabaseWrapper.create_cursor(self, " "name=None)`` 方法,以允许在支持的后端上使用服务器端游标。" msgid "Dropped support for PostgreSQL 9.2 and PostGIS 2.0" msgstr "不再支持 PostgreSQL 9.2 和 PostGIS 2.0 。" msgid "" "Upstream support for PostgreSQL 9.2 ends in September 2017. As a " "consequence, Django 1.11 sets PostgreSQL 9.3 as the minimum version it " "officially supports." msgstr "" "PostgreSQL 9.2 的上游支持将于 2017 年 9 月结束。因此,Django 1.11 将 " "PostgreSQL 9.3 设为其官方支持的最低版本。" msgid "" "Support for PostGIS 2.0 is also removed as PostgreSQL 9.2 is the last " "version to support it." msgstr "" "由于 PostgreSQL 9.2 是支持 PostGIS 2.0 的最后一个版本,因此也取消了对 " "PostGIS 2.0 的支持。" msgid "" "Also, the minimum supported version of psycopg2 is increased from 2.4.5 to " "2.5.4." msgstr "此外,支持的最低 psycopg2 版本从 2.4.5 提高到 2.5.4 。" msgid "``LiveServerTestCase`` binds to port zero" msgstr "``LiveServerTestCase`` 现在绑定到零端口" msgid "" "Rather than taking a port range and iterating to find a free port, " "``LiveServerTestCase`` binds to port zero and relies on the operating system " "to assign a free port. The ``DJANGO_LIVE_TEST_SERVER_ADDRESS`` environment " "variable is no longer used, and as it's also no longer used, the ``manage.py " "test --liveserver`` option is removed." msgstr "" "与其采用端口范围并迭代查找空闲端口,``LiveServerTestCase`` 现在绑定到零端口," "并依赖操作系统分配空闲端口。不再使用 ``DJANGO_LIVE_TEST_SERVER_ADDRESS`` 环境" "变量,也不再使用 ``manage.py test --liveserver`` 选项。" msgid "" "If you need to bind ``LiveServerTestCase`` to a specific port, use the " "``port`` attribute added in Django 1.11.2." msgstr "" "如果需要将 ``LiveServerTestCase`` 绑定到特定端口,可以使用 Django 1.11.2 中新" "增的 ``port`` 属性。" msgid "" "Protection against insecure redirects in :mod:`django.contrib.auth` and " "``i18n`` views" msgstr "" "在 :mod:`django.contrib.auth` 和 ``i18n`` 视图中加强了对不安全的重定向的保" "护。" msgid "" "``LoginView``, ``LogoutView`` (and the deprecated function-based " "equivalents), and :func:`~django.views.i18n.set_language` protect users from " "being redirected to non-HTTPS ``next`` URLs when the app is running over " "HTTPS." msgstr "" "``LoginView``、``LogoutView`` (以及已弃用的函数式等效版本)和 :func:" "`~django.views.i18n.set_language` 在应用程序运行在 HTTPS 上时,会保护用户免受" "被重定向到非 HTTPS 的 ``next`` URL 的影响。" msgid "" "``QuerySet.get_or_create()`` and ``update_or_create()`` validate arguments" msgstr "" "``QuerySet.get_or_create()`` 和 ``update_or_create()`` 现在会验证参数。" msgid "" "To prevent typos from passing silently, :meth:`~django.db.models.query." "QuerySet.get_or_create` and :meth:`~django.db.models.query.QuerySet." "update_or_create` check that their arguments are model fields. This should " "be backwards-incompatible only in the fact that it might expose a bug in " "your project." msgstr "" "为了防止拼写错误默默通过,:meth:`~django.db.models.query.QuerySet." "get_or_create` 和 :meth:`~django.db.models.query.QuerySet.update_or_create` " "检查它们的参数是否是模型字段。这只会在一个方面引入向后不兼容,可能会暴露出项" "目中的错误。" msgid "" "``pytz`` is a required dependency and support for ``settings.TIME_ZONE = " "None`` is removed" msgstr "" "``pytz`` 现在是必需的依赖项,不再支持将 ``settings.TIME_ZONE = None``。" msgid "" "To simplify Django's timezone handling, ``pytz`` is now a required " "dependency. It's automatically installed along with Django." msgstr "" "为了简化 Django 的时区处理,``pytz`` 现在是必需的依赖项,它会自动与 Django 一" "起安装。" msgid "" "Support for ``settings.TIME_ZONE = None`` is removed as the behavior isn't " "commonly used and is questionably useful. If you want to automatically " "detect the timezone based on the system timezone, you can use :pypi:" "`tzlocal`::" msgstr "" "不再支持 ``settings.TIME_ZONE = None``,因为这种行为通常不常用且可疑的有用" "性。如果希望根据系统时区自动检测时区,可以使用 :pypi:`tzlocal`。" msgid "" "This works similar to ``settings.TIME_ZONE = None`` except that it also sets " "``os.environ['TZ']``. `Let us know `__ if there's a use case where you find " "you can't adapt your code to set a ``TIME_ZONE``." msgstr "" "这与 ``settings.TIME_ZONE = None`` 类似,但它还设置了 ``os.environ['TZ']``。" "如果存在情况下,您发现无法适应设置 ``TIME_ZONE`` 的代码,请通过 `告诉我们 " "`__。" msgid "HTML changes in admin templates" msgstr "管理模板中的 HTML 更改" msgid "" "``

`` is replaced with a ``

`` tag to allow including " "lists inside help text." msgstr "" "``

`` 被替换为 ``

`` 标签,以允许在帮助文本中包含列表。" msgid "" "Read-only fields are wrapped in ``
...
`` " "instead of ``

...

`` to allow any kind of HTML as the field's content." msgstr "" "只读字段现在被包装在 ``
...
`` 中,而不是 " "``

...

``,以允许字段内容包含任何类型的 HTML。" msgid "Changes due to the introduction of template-based widget rendering" msgstr "由于引入基于模板的小部件渲染,发生了一些更改。" msgid "Some undocumented classes in ``django.forms.widgets`` are removed:" msgstr "移除了 ``django.forms.widgets`` 中一些未记录的类:" msgid "``SubWidget``" msgstr "``SubWidget``" msgid "" "``RendererMixin``, ``ChoiceFieldRenderer``, ``RadioFieldRenderer``, " "``CheckboxFieldRenderer``" msgstr "" "``RendererMixin``, ``ChoiceFieldRenderer``, ``RadioFieldRenderer``, " "``CheckboxFieldRenderer``" msgid "``ChoiceInput``, ``RadioChoiceInput``, ``CheckboxChoiceInput``" msgstr "``ChoiceInput``, ``RadioChoiceInput``, ``CheckboxChoiceInput``" msgid "The undocumented ``Select.render_option()`` method is removed." msgstr "移除了未记录的 ``Select.render_option()`` 方法。" msgid "" "The ``Widget.format_output()`` method is removed. Use a custom widget " "template instead." msgstr "移除了 ``Widget.format_output()`` 方法。请使用自定义小部件模板替代。" msgid "" "Some widget values, such as ```` 选项,将" "进行本地化。您可以通过使用 :ttag:`localize` 模板标签关闭本地化,恢复到旧的行" "为,使用自定义小部件模板。" msgid "" "``django.template.backends.django.Template.render()`` prohibits non-dict " "context" msgstr "" "``django.template.backends.django.Template.render()`` 禁止非字典上下文。" msgid "" "For compatibility with multiple template engines, ``django.template.backends." "django.Template.render()`` (returned from high-level template loader APIs " "such as ``loader.get_template()``) must receive a dictionary of context " "rather than ``Context`` or ``RequestContext``. If you were passing either of " "the two classes, pass a dictionary instead -- doing so is backwards-" "compatible with older versions of Django." msgstr "" "为了与多个模板引擎兼容,``django.template.backends.django.Template." "render()`` (从高级模板加载器 API(如 ``loader.get_template()``)返回)必须接" "收一个上下文字典,而不是 ``Context`` 或 ``RequestContext``。如果您之前传递了" "这两个类中的任何一个,请改为传递一个字典 - 这样做是向后兼容旧版本的 Django。" msgid "Model state changes in migration operations" msgstr "迁移操作中的模型状态更改" msgid "" "To improve the speed of applying migrations, rendering of related models is " "delayed until an operation that needs them (e.g. ``RunPython``). If you have " "a custom operation that works with model classes or model instances from the " "``from_state`` argument in ``database_forwards()`` or " "``database_backwards()``, you must render model states using the " "``clear_delayed_apps_cache()`` method as described in :ref:`writing your own " "migration operation `." msgstr "" "为了提高应用迁移的速度,延迟了相关模型的渲染,直到需要它们的操作(例如 " "``RunPython``)。如果您有一个自定义操作,需要在 ``database_forwards()`` 或 " "``database_backwards()`` 的 ``from_state`` 参数中使用模型类或模型实例,您必须" "使用 ``clear_delayed_apps_cache()`` 方法来渲染模型状态,如 :ref:`编写自己的迁" "移操作 ` 中所述。" msgid "Server-side cursors on PostgreSQL" msgstr "PostgreSQL 上的服务器端游标" msgid "" "The change to make :meth:`.QuerySet.iterator()` use server-side cursors on " "PostgreSQL prevents running Django with PgBouncer in transaction pooling " "mode. To reallow that, use the :setting:`DISABLE_SERVER_SIDE_CURSORS " "` setting (added in Django 1.11.1) in :" "setting:`DATABASES`." msgstr "" "将 :meth:`.QuerySet.iterator()` 使用服务器端游标在 PostgreSQL 上可能会阻止在" "事务池模式下使用 PgBouncer 运行 Django。要重新允许这样做,可以在 :setting:" "`DATABASES` 中使用 :setting:`DISABLE_SERVER_SIDE_CURSORS ` 设置(在 Django 1.11.1 中添加)。" msgid "See :ref:`transaction-pooling-server-side-cursors` for more discussion." msgstr "有关更多讨论,请参阅 :ref:`transaction-pooling-server-side-cursors`。" msgid "" "If no items in the feed have a ``pubdate`` or ``updateddate`` attribute, :" "meth:`SyndicationFeed.latest_post_date() ` now returns the current UTC date/time, " "instead of a datetime without any timezone information." msgstr "" "如果在 feed 中没有任何项目具有 ``pubdate`` 或 ``updateddate`` 属性,那么 :" "meth:`SyndicationFeed.latest_post_date() ` 现在会返回当前的 UTC 日期/时间,而不是一个" "没有任何时区信息的 datetime。" msgid "" "CSRF failures are logged to the ``django.security.csrf`` logger instead of " "``django.request``." msgstr "" "CSRF 失败现在会被记录到 ``django.security.csrf`` 日志器,而不是 ``django." "request``。" msgid "" ":setting:`ALLOWED_HOSTS` validation is no longer disabled when running " "tests. If your application includes tests with custom host names, you must " "include those host names in :setting:`ALLOWED_HOSTS`. See :ref:`topics-" "testing-advanced-multiple-hosts`." msgstr "" "运行测试时,不再禁用 :setting:`ALLOWED_HOSTS` 验证。如果您的应用程序包括具有" "自定义主机名的测试,您必须将这些主机名包含在 :setting:`ALLOWED_HOSTS` 中。请" "参阅 :ref:`topics-testing-advanced-multiple-hosts`。" msgid "" "Using a foreign key's id (e.g. ``'field_id'``) in ``ModelAdmin." "list_display`` displays the related object's ID. Remove the ``_id`` suffix " "if you want the old behavior of the string representation of the object." msgstr "" "在 ``ModelAdmin.list_display`` 中使用外键的 id(例如 ``'field_id'``)会显示相" "关对象的 ID。如果要恢复到对象的字符串表示的旧行为,请移除 ``_id`` 后缀。" msgid "" "In model forms, :class:`~django.db.models.CharField` with ``null=True`` now " "saves ``NULL`` for blank values instead of empty strings." msgstr "" "在模型表单中,具有 ``null=True`` 的 :class:`~django.db.models.CharField` 现在" "会为空白值保存 ``NULL``,而不是空字符串。" msgid "" "On Oracle, :meth:`Model.validate_unique() ` no longer checks empty strings for uniqueness as the " "database interprets the value as ``NULL``." msgstr "" "在 Oracle 上,:meth:`Model.validate_unique() ` 不再检查空字符串的唯一性,因为数据库会将该值解释为 " "``NULL``。" msgid "" "If you subclass :class:`.AbstractUser` and override ``clean()``, be sure it " "calls ``super()``. :meth:`.BaseUserManager.normalize_email` is called in a " "new :meth:`.AbstractUser.clean` method so that normalization is applied in " "cases like model form validation." msgstr "" "如果您子类化了 :class:`.AbstractUser` 并覆盖了 ``clean()`` 方法,请确保它调用" "了 ``super()``。新的 :meth:`.AbstractUser.clean` 方法中会调用 :meth:`." "BaseUserManager.normalize_email`,以便在模型表单验证等情况下应用标准化。" msgid "" "``EmailField`` and ``URLField`` no longer accept the ``strip`` keyword " "argument. Remove it because it doesn't have an effect in older versions of " "Django as these fields always strip whitespace." msgstr "" "``EmailField`` 和 ``URLField`` 不再接受 ``strip`` 关键字参数。移除它,因为在" "旧版本的 Django 中它没有任何效果,这些字段总是会去除空格。" msgid "" "The ``checked`` and ``selected`` attribute rendered by form widgets now uses " "HTML5 boolean syntax rather than XHTML's ``checked='checked'`` and " "``selected='selected'``." msgstr "" "表单小部件渲染的 ``checked`` 和 ``selected`` 属性现在使用 HTML5 布尔语法,而" "不再使用 XHTML 的 ``checked='checked'`` 和 ``selected='selected'``。" msgid "" ":meth:`RelatedManager.add() `, :meth:`~django.db.models.fields.related.RelatedManager.remove`, :meth:" "`~django.db.models.fields.related.RelatedManager.clear`, and :meth:`~django." "db.models.fields.related.RelatedManager.set` now clear the " "``prefetch_related()`` cache." msgstr "" ":meth:`RelatedManager.add() `、:meth:`~django.db.models.fields.related.RelatedManager.remove`、:meth:" "`~django.db.models.fields.related.RelatedManager.clear` 和 :meth:`~django.db." "models.fields.related.RelatedManager.set` 现在会清除 ``prefetch_related()`` " "缓存。" msgid "" "To prevent possible loss of saved settings, :func:`~django.test.utils." "setup_test_environment` now raises an exception if called a second time " "before calling :func:`~django.test.utils.teardown_test_environment`." msgstr "" "为防止可能丢失的保存设置,如果在调用 :func:`~django.test.utils." "teardown_test_environment` 之前再次调用 :func:`~django.test.utils." "setup_test_environment`,它现在会引发异常。" msgid "" "The undocumented ``DateTimeAwareJSONEncoder`` alias for :class:`~django.core." "serializers.json.DjangoJSONEncoder` (renamed in Django 1.0) is removed." msgstr "" "未记录的 ``DateTimeAwareJSONEncoder`` 别名(对于在 Django 1.0 中更名的 :" "class:`~django.core.serializers.json.DjangoJSONEncoder`)已被移除。" msgid "" "The :class:`cached template loader ` " "is now enabled if :setting:`OPTIONS['loaders'] ` isn't " "specified and :setting:`OPTIONS['debug'] ` is ``False`` " "(the latter option defaults to the value of :setting:`DEBUG`). This could be " "backwards-incompatible if you have some :ref:`template tags that aren't " "thread safe `." msgstr "" "如果没有指定 :setting:`OPTIONS['loaders'] ` 并且 :setting:" "`OPTIONS['debug'] ` 为 ``False`` (后者默认为 :setting:" "`DEBUG` 的值),则现在会启用 :class:`cached template loader `。如果您有一些不是线程安全的 :ref:`模板标签 " "`,这可能会导致不兼容。" msgid "" "The prompt for stale content type deletion no longer occurs after running " "the ``migrate`` command. Use the new :djadmin:`remove_stale_contenttypes` " "command instead." msgstr "" "过去在运行 ``migrate`` 命令之后不再提示删除陈旧的内容类型。现在请使用新的 :" "djadmin:`remove_stale_contenttypes` 命令。" msgid "" "The admin's widget for ``IntegerField`` uses ``type=\"number\"`` rather than " "``type=\"text\"``." msgstr "" "管理员界面中的 ``IntegerField`` 控件现在使用 ``type=\"number\"`` 而不是 " "``type=\"text\"``。" msgid "" "Conditional HTTP headers are now parsed and compared according to the :rfc:" "`7232` Conditional Requests specification rather than the older :rfc:`2616`." msgstr "" "现在,条件 HTTP 标头根据 :rfc:`7232` 的条件请求规范进行解析和比较,而不是较旧" "的 :rfc:`2616` 规范。" msgid "" ":func:`~django.utils.cache.patch_response_headers` no longer adds a ``Last-" "Modified`` header. According to the :rfc:`7234#section-4.2.2`, this header " "is useless alongside other caching headers that provide an explicit " "expiration time, e.g. ``Expires`` or ``Cache-Control``. :class:`~django." "middleware.cache.UpdateCacheMiddleware` and :func:`~django.utils.cache." "add_never_cache_headers` call ``patch_response_headers()`` and therefore are " "also affected by this change." msgstr "" ":func:`~django.utils.cache.patch_response_headers` 不再添加 ``Last-" "Modified`` 标头。根据 :rfc:`7234#section-4.2.2`,在提供明确的过期时间的其他缓" "存标头旁边,例如 ``Expires`` 或 ``Cache-Control``,此标头是无用的。因此,:" "class:`~django.middleware.cache.UpdateCacheMiddleware` 和 :func:`~django." "utils.cache.add_never_cache_headers` 调用 ``patch_response_headers()``,因此" "也受到此更改的影响。" msgid "" "In the admin templates, ``

`` is replaced with a ``

`` " "tag to allow including lists inside help text." msgstr "" "在管理模板中,``

`` 被替换为 ``

`` 标签,以允许在帮助文" "本中包含列表。" msgid "" ":class:`~django.middleware.http.ConditionalGetMiddleware` no longer sets the " "``Date`` header as web servers set that header. It also no longer sets the " "``Content-Length`` header as this is now done by :class:`~django.middleware." "common.CommonMiddleware`." msgstr "" ":class:`~django.middleware.http.ConditionalGetMiddleware` 不再设置 ``Date`` " "头,因为 web 服务器会设置该头。它也不再设置 ``Content-Length`` 头,因为现在" "由 :class:`~django.middleware.common.CommonMiddleware` 完成此操作。" msgid "" "If you have a middleware that modifies a response's content and appears " "before ``CommonMiddleware`` in the ``MIDDLEWARE`` or ``MIDDLEWARE_CLASSES`` " "settings, you must reorder your middleware so that responses aren't modified " "after ``Content-Length`` is set, or have the response modifying middleware " "reset the ``Content-Length`` header." msgstr "" "如果您有一个中间件在 ``MIDDLEWARE`` 或 ``MIDDLEWARE_CLASSES`` 设置中出现在 " "``CommonMiddleware`` 之前,并且修改响应的内容,那么您必须重新排列您的中间件," "以确保在设置 ``Content-Length`` 后不会修改响应,或者让修改响应的中间件重置 " "``Content-Length`` 头。" msgid "" ":meth:`~django.apps.AppConfig.get_model` and :meth:`~django.apps.AppConfig." "get_models` now raise :exc:`~django.core.exceptions.AppRegistryNotReady` if " "they're called before models of all applications have been loaded. " "Previously they only required the target application's models to be loaded " "and thus could return models without all their relations set up. If you need " "the old behavior of ``get_model()``, set the ``require_ready`` argument to " "``False``." msgstr "" ":meth:`~django.apps.AppConfig.get_model` 和 :meth:`~django.apps.AppConfig." "get_models` 现在在所有应用程序的模型加载之前调用时会引发 :exc:`~django.core." "exceptions.AppRegistryNotReady` 异常。以前它们只需要目标应用程序的模型被加" "载,因此可能返回未完全设置其关系的模型。如果您需要 ``get_model()`` 的旧行为," "请将 ``require_ready`` 参数设置为 ``False``。" msgid "The unused ``BaseCommand.can_import_settings`` attribute is removed." msgstr "未使用的 ``BaseCommand.can_import_settings`` 属性已被删除。" msgid "The undocumented ``django.utils.functional.lazy_property`` is removed." msgstr "未记录的 ``django.utils.functional.lazy_property`` 已被移除。" msgid "" "For consistency with non-multipart requests, ``MultiPartParser.parse()`` now " "leaves ``request.POST`` immutable. If you're modifying that ``QueryDict``, " "you must now first copy it, e.g. ``request.POST.copy()``." msgstr "" "为了与非多部分请求保持一致,``MultiPartParser.parse()`` 现在会使 ``request." "POST`` 保持不可变性。如果你要修改那个 ``QueryDict``,你现在必须先复制它,例" "如 ``request.POST.copy()``。" msgid "Support for ``cx_Oracle`` < 5.2 is removed." msgstr "对于 ``cx_Oracle`` 版本小于 5.2 的支持已被移除。" msgid "Support for IPython < 1.0 is removed from the ``shell`` command." msgstr "对于 IPython 版本小于 1.0 的支持已从 ``shell`` 命令中移除。" msgid "" "The signature of private API ``Widget.build_attrs()`` changed from " "``extra_attrs=None, **kwargs`` to ``base_attrs, extra_attrs=None``." msgstr "" "私有 API ``Widget.build_attrs()`` 的签名已从 ``extra_attrs=None, **kwargs`` " "更改为 ``base_attrs, extra_attrs=None``。" msgid "" "File-like objects (e.g., :class:`~io.StringIO` and :class:`~io.BytesIO`) " "uploaded to an :class:`~django.db.models.ImageField` using the test client " "now require a ``name`` attribute with a value that passes the :data:`~django." "core.validators.validate_image_file_extension` validator. See the note in :" "meth:`.Client.post`." msgstr "" "通过测试客户端上传到一个 :class:`~django.db.models.ImageField` 的类似文件的对" "象(例如 :class:`~io.StringIO` 和 :class:`~io.BytesIO`)现在需要一个具有通" "过 :data:`~django.core.validators.validate_image_file_extension` 验证器的值" "的 ``name`` 属性。请参阅 :meth:`.Client.post` 中的注意事项。" msgid "" ":class:`~django.db.models.FileField` now moves rather than copies the file " "it receives. With the default file upload settings, files larger than :" "setting:`FILE_UPLOAD_MAX_MEMORY_SIZE` now have the same permissions as " "temporary files (often ``0o600``) rather than the system's standard umask " "(often ``0o6644``). Set the :setting:`FILE_UPLOAD_PERMISSIONS` if you need " "the same permission regardless of file size." msgstr "" ":class:`~django.db.models.FileField` 现在会移动文件而不是复制它所接收的文件。" "使用默认的文件上传设置,文件大小超过 :setting:`FILE_UPLOAD_MAX_MEMORY_SIZE` " "的文件现在具有与临时文件相同的权限(通常是 ``0o600``),而不是系统的标准掩码" "(通常是 ``0o644``)。如果您需要不考虑文件大小都具有相同权限,请设置 :" "setting:`FILE_UPLOAD_PERMISSIONS`。" msgid "Features deprecated in 1.11" msgstr "在 1.11 中被废弃的功能" msgid "``models.permalink()`` decorator" msgstr "``models.permalink()`` 装饰器" msgid "Use :func:`django.urls.reverse` instead. For example::" msgstr "请使用 :func:`django.urls.reverse`。例如:" msgid "becomes::" msgstr "变成:" msgid "" "``contrib.auth``’s ``login()`` and ``logout()`` function-based views are " "deprecated in favor of new class-based views :class:`~django.contrib.auth." "views.LoginView` and :class:`~django.contrib.auth.views.LogoutView`." msgstr "" "``contrib.auth`` 中的 ``login()`` 和 ``logout()`` 基于函数的视图已被弃用,推" "荐使用新的基于类的视图 :class:`~django.contrib.auth.views.LoginView` 和 :" "class:`~django.contrib.auth.views.LogoutView`。" msgid "" "The unused ``extra_context`` parameter of ``contrib.auth.views." "logout_then_login()`` is deprecated." msgstr "" "``contrib.auth.views.logout_then_login()`` 的未使用的 ``extra_context`` 参数" "已被弃用。" msgid "" "``contrib.auth``’s ``password_change()``, ``password_change_done()``, " "``password_reset()``, ``password_reset_done()``, " "``password_reset_confirm()``, and ``password_reset_complete()`` function-" "based views are deprecated in favor of new class-based views :class:`~django." "contrib.auth.views.PasswordChangeView`, :class:`~django.contrib.auth.views." "PasswordChangeDoneView`, :class:`~django.contrib.auth.views." "PasswordResetView`, :class:`~django.contrib.auth.views." "PasswordResetDoneView`, :class:`~django.contrib.auth.views." "PasswordResetConfirmView`, and :class:`~django.contrib.auth.views." "PasswordResetCompleteView`." msgstr "" "``contrib.auth`` 中的 ``password_change()``, ``password_change_done()``, " "``password_reset()``, ``password_reset_done()``, " "``password_reset_confirm()``, 和 ``password_reset_complete()`` 基于函数的视图" "已被弃用,推荐使用新的基于类的视图 :class:`~django.contrib.auth.views." "PasswordChangeView`, :class:`~django.contrib.auth.views." "PasswordChangeDoneView`, :class:`~django.contrib.auth.views." "PasswordResetView`, :class:`~django.contrib.auth.views." "PasswordResetDoneView`, :class:`~django.contrib.auth.views." "PasswordResetConfirmView`, 和 :class:`~django.contrib.auth.views." "PasswordResetCompleteView`。" msgid "" "``django.test.runner.setup_databases()`` is moved to :func:`django.test." "utils.setup_databases`. The old location is deprecated." msgstr "" "``django.test.runner.setup_databases()`` 已移至 :func:`django.test.utils." "setup_databases`。旧位置已被弃用。" msgid "" "``django.utils.translation.string_concat()`` is deprecated in favor of :func:" "`django.utils.text.format_lazy`. ``string_concat(*strings)`` can be replaced " "by ``format_lazy('{}' * len(strings), *strings)``." msgstr "" "``django.utils.translation.string_concat()`` 已被弃用,推荐使用 :func:" "`django.utils.text.format_lazy`。可以通过 ``format_lazy('{}' * len(strings), " "*strings)`` 来替代 ``string_concat(*strings)``。" msgid "" "For the ``PyLibMCCache`` cache backend, passing ``pylibmc`` behavior " "settings as top-level attributes of ``OPTIONS`` is deprecated. Set them " "under a ``behaviors`` key within ``OPTIONS`` instead." msgstr "" "对于 ``PyLibMCCache`` 缓存后端,将 ``pylibmc`` 行为设置作为 ``OPTIONS`` 的顶" "级属性传递已被弃用。请将它们设置在 ``OPTIONS`` 内的 ``behaviors`` 键下。" msgid "" "The ``host`` parameter of ``django.utils.http.is_safe_url()`` is deprecated " "in favor of the new ``allowed_hosts`` parameter." msgstr "" "``django.utils.http.is_safe_url()`` 的 ``host`` 参数已被弃用,推荐使用新的 " "``allowed_hosts`` 参数。" msgid "" "Silencing exceptions raised while rendering the :ttag:`{% include %} " "` template tag is deprecated as the behavior is often more " "confusing than helpful. In Django 2.1, the exception will be raised." msgstr "" "在渲染 :ttag:`{% include %} ` 模板标签时抑制异常已被弃用,因为这种行" "为通常会比有帮助更令人困惑。在 Django 2.1 中,将会引发异常。" msgid "" "``DatabaseIntrospection.get_indexes()`` is deprecated in favor of " "``DatabaseIntrospection.get_constraints()``." msgstr "" "``DatabaseIntrospection.get_indexes()`` 已被弃用,推荐使用 " "``DatabaseIntrospection.get_constraints()``。" msgid "" ":func:`~django.contrib.auth.authenticate` now passes a ``request`` argument " "to the ``authenticate()`` method of authentication backends. Support for " "methods that don't accept ``request`` as the first positional argument will " "be removed in Django 2.1." msgstr "" ":func:`~django.contrib.auth.authenticate` 现在向身份验证后端的 " "``authenticate()`` 方法传递一个 ``request`` 参数。不接受 ``request`` 作为第一" "个位置参数的方法将在 Django 2.1 中被移除。" msgid "" "The ``USE_ETAGS`` setting is deprecated in favor of :class:`~django." "middleware.http.ConditionalGetMiddleware` which now adds the ``ETag`` header " "to responses regardless of the setting. ``CommonMiddleware`` and ``django." "utils.cache.patch_response_headers()`` will no longer set ETags when the " "deprecation ends." msgstr "" "``USE_ETAGS`` 设置已被弃用,推荐使用 :class:`~django.middleware.http." "ConditionalGetMiddleware`,它现在会在响应中添加 ``ETag`` 头,不受设置的影响。" "当弃用结束时,``CommonMiddleware`` 和 ``django.utils.cache." "patch_response_headers()`` 将不再设置 ETags。" msgid "" "``Model._meta.has_auto_field`` is deprecated in favor of checking if ``Model." "_meta.auto_field is not None``." msgstr "" "``Model._meta.has_auto_field`` 已被弃用,推荐检查 ``Model._meta.auto_field " "is not None``。" msgid "" "Using regular expression groups with ``iLmsu#`` in ``url()`` is deprecated. " "The only group that's useful is ``(?i)`` for case-insensitive URLs, however, " "case-insensitive URLs aren't a good practice because they create multiple " "entries for search engines, for example. An alternative solution could be to " "create a :data:`~django.conf.urls.handler404` that looks for uppercase " "characters in the URL and redirects to a lowercase equivalent." msgstr "" "在 ``url()`` 中使用带有 ``iLmsu#`` 的正则表达式组已被弃用。唯一有用的组是 " "``(?i)`` 用于不区分大小写的 URL,但是不区分大小写的 URL 并不是一个好的实践," "因为它们会为搜索引擎创建多个条目,例如。一个替代方案可能是创建一个 :data:" "`~django.conf.urls.handler404`,它查找 URL 中的大写字符并重定向到相应的小写字" "符。" msgid "" "The ``renderer`` argument is added to the :meth:`Widget.render() ` method. Methods that don't accept that argument will " "work through a deprecation period." msgstr "" "``renderer`` 参数已添加到 :meth:`Widget.render() ` 方法。不接受该参数的方法将在一个弃用期内继续工作。" msgid "Django 1.11.1 release notes" msgstr "Django 1.11.1 版本发行说明" msgid "*May 6, 2017*" msgstr "*2017 年 5 月 6 日*" msgid "Django 1.11.1 adds a minor feature and fixes several bugs in 1.11." msgstr "Django 1.11.1 添加了一个小功能,并修复了 1.11 中的若干错误。" msgid "Allowed disabling server-side cursors on PostgreSQL" msgstr "允许在 PostgreSQL 上禁用服务器端游标" msgid "" "The change in Django 1.11 to make :meth:`.QuerySet.iterator()` use server-" "side cursors on PostgreSQL prevents running Django with PgBouncer in " "transaction pooling mode. To reallow that, use the :setting:" "`DISABLE_SERVER_SIDE_CURSORS ` setting " "in :setting:`DATABASES`." msgstr "" "Django 1.11 中对 :meth:`.QuerySet.iterator()` 的更改使其在 PostgreSQL 上使用" "服务器端游标,这会阻止在事务池模式下使用 PgBouncer 运行 Django。要重新允许这" "个行为,请在 :setting:`DATABASES` 的设置中使用 :setting:" "`DISABLE_SERVER_SIDE_CURSORS ` 设置。" msgid "" "Made migrations respect ``Index``’s ``name`` argument. If you created a " "named index with Django 1.11, ``makemigrations`` will create a migration to " "recreate the index with the correct name (:ticket:`28051`)." msgstr "" "迁移现在会尊重 ``Index`` 的 ``name`` 参数。如果你在 Django 1.11 中创建了一个" "具有名称的索引,``makemigrations`` 将创建一个迁移来重新创建具有正确名称的索" "引 (:ticket:`28051`)。" msgid "" "Fixed a crash when using a ``__icontains`` lookup on a ``ArrayField`` (:" "ticket:`28038`)." msgstr "" "修复了在 ``ArrayField`` 上使用 ``__icontains`` 查找时的崩溃问题 (:ticket:" "`28038`)。" msgid "" "Fixed a crash when using a 2-tuple in ``EmailMessage``’s ``attachments`` " "argument (:ticket:`28042`)." msgstr "" "修复了在 ``EmailMessage`` 的 ``attachments`` 参数中使用 2 元组时崩溃的问题 (:" "ticket:`28042`)。" msgid "" "Fixed ``QuerySet.filter()`` crash when it references the name of a " "``OneToOneField`` primary key (:ticket:`28047`)." msgstr "" "修复了当 ``QuerySet.filter()`` 引用 ``OneToOneField`` 主键的名称时导致的崩溃 " "(:ticket:`28047`)。" msgid "" "Fixed empty POST data table appearing instead of \"No POST data\" in HTML " "debug page (:ticket:`28079`)." msgstr "" "修复了在 HTML 调试页面中出现空的 POST 数据表格,而不是显示 \"No POST " "data\" (:ticket:`28079`)。" msgid "" "Restored ``BoundField``\\s without any ``choices`` evaluating to ``True`` (:" "ticket:`28058`)." msgstr "" "恢复了 ``BoundField`` 中没有任何 ``choices`` 的情况下被评估为 ``True`` (:" "ticket:`28058`)。" msgid "" "Prevented ``SessionBase.cycle_key()`` from losing session data if " "``_session_cache`` isn't populated (:ticket:`28066`)." msgstr "" "防止在 ``_session_cache`` 未填充的情况下使 ``SessionBase.cycle_key()`` 丢失会" "话数据 (:ticket:`28066`)。" msgid "" "Fixed layout of ``ReadOnlyPasswordHashWidget`` (used in the admin's user " "change page) (:ticket:`28097`)." msgstr "" "修复了 ``ReadOnlyPasswordHashWidget`` 的布局(在管理员的用户更改页面中使用) " "(:ticket:`28097`)。" msgid "" "Allowed prefetch calls on managers with custom ``ModelIterable`` subclasses " "(:ticket:`28096`)." msgstr "" "允许在具有自定义 ``ModelIterable`` 子类的管理器上进行预取调用 (:ticket:" "`28096`)。" msgid "" "Fixed change password link in the ``contrib.auth`` admin for ``el``, " "``es_MX``, and ``pt`` translations (:ticket:`28100`)." msgstr "" "修复了 ``contrib.auth`` 管理员中的更改密码链接,适用于 ``el``、``es_MX`` 和 " "``pt`` 翻译 (:ticket:`28100`)。" msgid "" "Restored the output of the ``class`` attribute in the ``
    `` of widgets " "that use the ``multiple_input.html`` template. This fixes ``ModelAdmin." "radio_fields`` with ``admin.HORIZONTAL`` (:ticket:`28059`)." msgstr "" "恢复了在使用 ``multiple_input.html`` 模板的小部件的 ``
      `` 中的 ``class`` " "属性的输出。这修复了使用 ``admin.HORIZONTAL`` 的 ``ModelAdmin.radio_fields`` " "(:ticket:`28059`)。" msgid "Fixed crash in ``BaseGeometryWidget.subwidgets()`` (:ticket:`28039`)." msgstr "" "修复了 ``BaseGeometryWidget.subwidgets()`` 中的崩溃 (:ticket:`28039`)。" msgid "" "Fixed exception reraising in ORM query execution when ``cursor.execute()`` " "fails and the subsequent ``cursor.close()`` also fails (:ticket:`28091`)." msgstr "" "修复了在 ORM 查询执行中,当 ``cursor.execute()`` 失败并且随后的 ``cursor." "close()`` 也失败时重新引发异常 (:ticket:`28091`)。" msgid "" "Fixed a regression where ``CheckboxSelectMultiple``, ``NullBooleanSelect``, " "``RadioSelect``, ``SelectMultiple``, and ``Select`` localized option values " "(:ticket:`28075`)." msgstr "" "修复了一个回归问题,其中 ``CheckboxSelectMultiple``、``NullBooleanSelect``、" "``RadioSelect``、``SelectMultiple`` 和 ``Select`` 的本地化选项值 (:ticket:" "`28075`)。" msgid "" "Corrected the stack level of unordered queryset pagination warnings (:ticket:" "`28109`)." msgstr "修正了无序查询集分页警告的堆栈级别 (:ticket:`28109`)。" msgid "" "Fixed a regression causing incorrect queries for ``__in`` subquery lookups " "when models use ``ForeignKey.to_field`` (:ticket:`28101`)." msgstr "" "修复了回归问题,当模型使用 ``ForeignKey.to_field`` 时,导致 ``__in`` 子查询查" "找的查询不正确 (:ticket:`28101`)。" msgid "" "Fixed crash when overriding the template of ``django.views.static." "directory_index()`` (:ticket:`28122`)." msgstr "" "修复了在重写 ``django.views.static.directory_index()`` 模板时的崩溃问题 (:" "ticket:`28122`)。" msgid "" "Fixed a regression in formset ``min_num`` validation with unchanged forms " "that have initial data (:ticket:`28130`)." msgstr "" "修复了在表单集 ``min_num`` 验证中的回归问题,当未更改具有初始数据的表单时 (:" "ticket:`28130`)。" msgid "Prepared for ``cx_Oracle`` 6.0 support (:ticket:`28138`)." msgstr "准备好支持 ``cx_Oracle`` 6.0 (:ticket:`28138`)。" msgid "" "Updated the ``contrib.postgres`` ``SplitArrayWidget`` to use template-based " "widget rendering (:ticket:`28040`)." msgstr "" "更新了 ``contrib.postgres`` 中的 ``SplitArrayWidget``,使用基于模板的小部件渲" "染 (:ticket:`28040`)。" msgid "" "Fixed crash in ``BaseGeometryWidget.get_context()`` when overriding existing " "``attrs`` (:ticket:`28105`)." msgstr "" "修复了在覆盖现有 ``attrs`` 时导致的 ``BaseGeometryWidget.get_context()`` 崩" "溃 (:ticket:`28105`)。" msgid "" "Prevented ``AddIndex`` and ``RemoveIndex`` from mutating model state (:" "ticket:`28043`)." msgstr "" "阻止了 ``AddIndex`` 和 ``RemoveIndex`` 对模型状态进行更改 (:ticket:`28043`)。" msgid "" "Prevented migrations from dropping database indexes from ``Meta.indexes`` " "when changing ``Field.db_index`` to ``False`` (:ticket:`28052`)." msgstr "" "阻止了在将 ``Field.db_index`` 更改为 ``False`` 时,迁移从 ``Meta.indexes`` 中" "删除数据库索引 (:ticket:`28052`)。" msgid "" "Fixed a regression in choice ordering in form fields with grouped and non-" "grouped options (:ticket:`28157`)." msgstr "" "修复了在具有分组和非分组选项的表单字段中选择顺序的退化问题 (:ticket:" "`28157`)。" msgid "" "Fixed crash in ``BaseInlineFormSet._construct_form()`` when using " "``save_as_new`` (:ticket:`28159`)." msgstr "" "修复了在使用 ``save_as_new`` 时导致的 ``BaseInlineFormSet." "_construct_form()`` 崩溃 (:ticket:`28159`)。" msgid "" "Fixed a regression where ``Model._state.db`` wasn't set correctly on multi-" "table inheritance parent models after saving a child model (:ticket:`28166`)." msgstr "" "修复了在保存子模型后,多表继承父模型上未正确设置 ``Model._state.db`` 的退化问" "题 (:ticket:`28166`)。" msgid "" "Corrected the return type of ``ArrayField(CITextField())`` values retrieved " "from the database (:ticket:`28161`)." msgstr "" "已更正从数据库中检索的 ``ArrayField(CITextField())`` 值的返回类型 (:ticket:" "`28161`)。" msgid "" "Fixed ``QuerySet.prefetch_related()`` crash when fetching relations in " "nested ``Prefetch`` objects (:ticket:`27554`)." msgstr "" "修复了在获取嵌套的 ``Prefetch`` 对象中的关系时导致的 ``QuerySet." "prefetch_related()`` 崩溃问题 (:ticket:`27554`)。" msgid "" "Prevented hiding GDAL errors if it's not installed when using ``contrib." "gis`` (:ticket:`28160`). (It's a required dependency as of Django 1.11.)" msgstr "" "在使用 ``contrib.gis`` 时,防止隐藏 GDAL 错误,如果它未安装的话 (:ticket:" "`28160`)。 (自 Django 1.11 起,它是一个必需的依赖项。)" msgid "" "Fixed a regression causing ``__in`` lookups on a foreign key to fail when " "using the foreign key's parent model as the lookup value (:ticket:`28175`)." msgstr "" "修复了使用外键的父模型作为查找值时导致 ``__in`` 查找失败的退化问题 (:ticket:" "`28175`)。" msgid "Django 1.11.10 release notes" msgstr "Django 1.11.10 版本发行说明" msgid "*February 1, 2018*" msgstr "*2018 年 2 月 1 日*" msgid "Django 1.11.10 fixes a security issue and several bugs in 1.11.9." msgstr "Django 1.11.10 修复了 1.11.9 中的一个安全问题和几个漏洞。" msgid "CVE-2018-6188: Information leakage in ``AuthenticationForm``" msgstr "CVE-2018-6188: ``AuthenticationForm`` 中的信息泄露问题" msgid "" "A regression in Django 1.11.8 made :class:`~django.contrib.auth.forms." "AuthenticationForm` run its ``confirm_login_allowed()`` method even if an " "incorrect password is entered. This can leak information about a user, " "depending on what messages ``confirm_login_allowed()`` raises. If " "``confirm_login_allowed()`` isn't overridden, an attacker enter an arbitrary " "username and see if that user has been set to ``is_active=False``. If " "``confirm_login_allowed()`` is overridden, more sensitive details could be " "leaked." msgstr "" "Django 1.11.8 中的一个退化问题导致 :class:`~django.contrib.auth.forms." "AuthenticationForm` 即使输入了不正确的密码,也会运行其 " "``confirm_login_allowed()`` 方法。这可能会泄露关于用户的信息,具体取决于 " "``confirm_login_allowed()`` 引发了什么消息。如果未覆盖 " "``confirm_login_allowed()``,攻击者可以输入任意用户名并查看该用户是否已设置" "为 ``is_active=False``。如果覆盖了 ``confirm_login_allowed()``,则可能会泄露" "更敏感的详细信息。" msgid "" "This issue is fixed with the caveat that ``AuthenticationForm`` can no " "longer raise the \"This account is inactive.\" error if the authentication " "backend rejects inactive users (the default authentication backend, " "``ModelBackend``, has done that since Django 1.10). This issue will be " "revisited for Django 2.1 as a fix to address the caveat will likely be too " "invasive for inclusion in older versions." msgstr "" "这个问题已经得到修复,但需要注意的是,如果身份验证后端拒绝非活动用户(默认身" "份验证后端“ModelBackend”自 Django 1.10 起就一直是这样),那么 " "``AuthenticationForm`` 不再会引发“此帐户处于非活动状态。”错误。这个问题将在 " "Django 2.1 中重新审查,因为解决这个问题的修复措施可能对旧版本来说过于侵入性。" msgid "" "Fixed incorrect foreign key nullification if a model has two foreign keys to " "the same model and a target model is deleted (:ticket:`29016`)." msgstr "" "修复了如果一个模型有两个指向同一模型的外键,且目标模型被删除时外键空值化不正" "确的问题 (:ticket:`29016`)。" msgid "" "Fixed a regression where ``contrib.auth.authenticate()`` crashes if an " "authentication backend doesn't accept ``request`` and a later one does (:" "ticket:`29071`)." msgstr "" "修复了一个退化问题,即如果身份验证后端不接受 ``request``,而后续的后端接受" "它,``contrib.auth.authenticate()`` 会崩溃的问题 (:ticket:`29071`)。" msgid "" "Fixed crash when entering an invalid uuid in ``ModelAdmin.raw_id_fields`` (:" "ticket:`29094`)." msgstr "" "修复了在 ``ModelAdmin.raw_id_fields`` 中输入无效 UUID 时导致崩溃的问题 (:" "ticket:`29094`)。" msgid "Django 1.11.11 release notes" msgstr "Django 1.11.11 版本发行说明" msgid "*March 6, 2018*" msgstr "*2018 年 3 月 6 日*" msgid "Django 1.11.11 fixes two security issues in 1.11.10." msgstr "Django 1.11.11 修复了 1.11.10 中的两个安全问题。" msgid "" "CVE-2018-7536: Denial-of-service possibility in ``urlize`` and " "``urlizetrunc`` template filters" msgstr "" "CVE-2018-7536: ``urlize`` 和 ``urlizetrunc`` 模板过滤器中的拒绝服务可能性问题" msgid "" "The ``django.utils.html.urlize()`` function was extremely slow to evaluate " "certain inputs due to catastrophic backtracking vulnerabilities in two " "regular expressions. The ``urlize()`` function is used to implement the " "``urlize`` and ``urlizetrunc`` template filters, which were thus vulnerable." msgstr "" "``django.utils.html.urlize()`` 函数在处理某些输入时非常慢,这是由于两个正则表" "达式中的灾难性回溯漏洞引起的。``urlize()`` 函数用于实现 ``urlize`` 和 " "``urlizetrunc`` 模板过滤器,因此这两个过滤器也存在漏洞。" msgid "" "The problematic regular expressions are replaced with parsing logic that " "behaves similarly." msgstr "问题正则表达式被替换为具有相似行为的解析逻辑。" msgid "" "CVE-2018-7537: Denial-of-service possibility in ``truncatechars_html`` and " "``truncatewords_html`` template filters" msgstr "" "CVE-2018-7537: ``truncatechars_html`` 和 ``truncatewords_html`` 模板过滤器中" "存在拒绝服务可能性问题。" msgid "" "If ``django.utils.text.Truncator``'s ``chars()`` and ``words()`` methods " "were passed the ``html=True`` argument, they were extremely slow to evaluate " "certain inputs due to a catastrophic backtracking vulnerability in a regular " "expression. The ``chars()`` and ``words()`` methods are used to implement " "the ``truncatechars_html`` and ``truncatewords_html`` template filters, " "which were thus vulnerable." msgstr "" "如果给 ``django.utils.text.Truncator`` 的 ``chars()`` 和 ``words()`` 方法传递" "了 ``html=True`` 参数,由于正则表达式中的灾难性回溯漏洞,它们在处理某些输入时" "非常慢。``chars()`` 和 ``words()`` 方法用于实现 ``truncatechars_html`` 和 " "``truncatewords_html`` 模板过滤器,因此这两个过滤器也存在漏洞。" msgid "The backtracking problem in the regular expression is fixed." msgstr "正则表达式中的回溯问题已经修复。" msgid "Django 1.11.12 release notes" msgstr "Django 1.11.12 版本发行说明" msgid "*April 2, 2018*" msgstr "*2018 年 4 月 2 日*" msgid "Django 1.11.12 fixes two bugs in 1.11.11." msgstr "Django 1.11.12 修复了 1.11.11 中的两个漏洞。" msgid "" "Fixed a regression in Django 1.11.8 where combining two annotated " "``values_list()`` querysets with ``union()``, ``difference()``, or " "``intersection()`` crashed due to mismatching columns (:ticket:`29229`)." msgstr "" "修复了在 Django 1.11.8 中的一个退化问题,即将两个经过注释的 " "``values_list()`` 查询集与 ``union()``, ``difference()`` 或 " "``intersection()`` 结合时因列不匹配而导致崩溃的问题 (:ticket:`29229`)。" msgid "" "Fixed a regression in Django 1.11 where an empty choice could be initially " "selected for the ``SelectMultiple`` and ``CheckboxSelectMultiple`` widgets (:" "ticket:`29273`)." msgstr "" "修复了 Django 1.11 中的一个退化问题,即对于 ``SelectMultiple`` 和 " "``CheckboxSelectMultiple`` 小部件,初始情况下可以选择一个空的选项 (:ticket:" "`29273`)。" msgid "Django 1.11.13 release notes" msgstr "Django 1.11.13 版本发行说明" msgid "*May 1, 2018*" msgstr "*2018 年 5 月 1 日*" msgid "Django 1.11.13 fixes several bugs in 1.11.12." msgstr "Django 1.11.13 修复了 1.11.12 中的几个漏洞。" msgid "" "Fixed a regression in Django 1.11.8 where altering a field with a unique " "constraint may drop and rebuild more foreign keys than necessary (:ticket:" "`29193`)." msgstr "" "修复了 Django 1.11.8 中的一个退化问题,即更改具有唯一约束的字段可能会删除和重" "建比必要更多的外键 (:ticket:`29193`)。" msgid "" "Fixed crashes in ``django.contrib.admindocs`` when a view is a callable " "object, such as ``django.contrib.syndication.views.Feed`` (:ticket:`29296`)." msgstr "" "修复了在 ``django.contrib.admindocs`` 中当一个视图是可调用对象(例如 " "``django.contrib.syndication.views.Feed``)时导致崩溃的问题 (:ticket:" "`29296`)。" msgid "" "Fixed a regression in Django 1.11.12 where ``QuerySet.values()`` or " "``values_list()`` after combining an annotated and unannotated queryset with " "``union()``, ``difference()``, or ``intersection()`` crashed due to " "mismatching columns (:ticket:`29286`)." msgstr "" "修复了 Django 1.11.12 中的一个退化问题,即在使用 ``union()``, " "``difference()`` 或 ``intersection()`` 合并了一个经过注释和未经注释的查询集" "后,调用 ``QuerySet.values()`` 或 ``values_list()`` 导致由于列不匹配而崩溃的" "问题 (:ticket:`29286`)。" msgid "Django 1.11.14 release notes" msgstr "Django 1.11.14 版本发行说明" msgid "*July 2, 2018*" msgstr "*2018 年 7 月 2 日*" msgid "Django 1.11.14 fixes several bugs in 1.11.13." msgstr "Django 1.11.14 修复了 1.11.13 中的几个漏洞。" msgid "" "Fixed ``WKBWriter.write()`` and ``write_hex()`` for empty polygons on GEOS " "3.6.1+ (:ticket:`29460`)." msgstr "" "修复了 GEOS 3.6.1+ 上的空多边形情况下的 ``WKBWriter.write()`` 和 " "``write_hex()`` 方法 (:ticket:`29460`)。" msgid "" "Fixed a regression in Django 1.10 that could result in large memory usage " "when making edits using ``ModelAdmin.list_editable`` (:ticket:`28462`)." msgstr "" "修复了 Django 1.10 中的一个退化问题,可能导致在使用 ``ModelAdmin." "list_editable`` 进行编辑时出现大内存使用的问题 (:ticket:`28462`)。" msgid "Django 1.11.15 release notes" msgstr "Django 1.11.15 版本发行说明" msgid "*August 1, 2018*" msgstr "*2018 年 8 月 1 日*" msgid "Django 1.11.15 fixes a security issue in 1.11.14." msgstr "Django 1.11.15 修复了 1.11.14 中的一个安全问题。" msgid "CVE-2018-14574: Open redirect possibility in ``CommonMiddleware``" msgstr "CVE-2018-14574: ``CommonMiddleware`` 中存在开放重定向漏洞的可能性。" msgid "" "If the :class:`~django.middleware.common.CommonMiddleware` and the :setting:" "`APPEND_SLASH` setting are both enabled, and if the project has a URL " "pattern that accepts any path ending in a slash (many content management " "systems have such a pattern), then a request to a maliciously crafted URL of " "that site could lead to a redirect to another site, enabling phishing and " "other attacks." msgstr "" "如果同时启用了 :class:`~django.middleware.common.CommonMiddleware` 和 :" "setting:`APPEND_SLASH` 设置,并且项目具有接受以斜杠结尾的任何路径的 URL 模式" "(许多内容管理系统都有这样的模式),那么对站点的恶意构造的 URL 的请求可能会导" "致重定向到另一个站点,从而可能启用钓鱼和其他攻击。" msgid "" "``CommonMiddleware`` now escapes leading slashes to prevent redirects to " "other domains." msgstr "" "现在,``CommonMiddleware`` 对于防止重定向到其他域的情况会转义开头的斜杠。" msgid "Django 1.11.16 release notes" msgstr "Django 1.11.16 版本发行说明" msgid "*October 1, 2018*" msgstr "*2018 年 10 月 1 日*" msgid "Django 1.11.16 fixes a data loss bug in 1.11.15." msgstr "Django 1.11.16 修复了 1.11.15 中的一个数据丢失漏洞。" msgid "" "Fixed a race condition in ``QuerySet.update_or_create()`` that could result " "in data loss (:ticket:`29499`)." msgstr "" "修复了 ``QuerySet.update_or_create()`` 中的竞态条件,可能导致数据丢失的问题 " "(:ticket:`29499`)。" msgid "Django 1.11.17 release notes" msgstr "Django 1.11.17 版本发行说明" msgid "*December 3, 2018*" msgstr "*2018 年 12 月 3 日*" msgid "" "Django 1.11.17 fixes several bugs in 1.11.16 and adds compatibility with " "Python 3.7." msgstr "" "Django 1.11.17 修复了 1.11.16 中的几个漏洞,并增加了对 Python 3.7 的兼容性。" msgid "" "Prevented repetitive calls to ``geos_version_tuple()`` in the ``WKBWriter`` " "class in an attempt to fix a random crash involving ``LooseVersion`` since " "Django 1.11.14 (:ticket:`29959`)." msgstr "" "为了尝试解决自 Django 1.11.14 以来涉及 ``LooseVersion`` 的随机崩溃问题,阻止" "了对 ``WKBWriter`` 类中的 ``geos_version_tuple()`` 的重复调用 (:ticket:" "`29959`)。" msgid "Django 1.11.18 release notes" msgstr "Django 1.11.18 版本发行说明" msgid "*January 4, 2019*" msgstr "*2019 年 1 月 4 日*" msgid "Django 1.11.18 fixes a security issue in 1.11.17." msgstr "Django 1.11.18 修复了 1.11.17 中的一个安全问题。" msgid "CVE-2019-3498: Content spoofing possibility in the default 404 page" msgstr "CVE- 2019-3498 :默认 404 页面中的内容欺骗可能性" msgid "" "An attacker could craft a malicious URL that could make spoofed content " "appear on the default page generated by the ``django.views.defaults." "page_not_found()`` view." msgstr "" "攻击者可以构造恶意 URL,使伪造的内容出现在由 ``django.views.defaults." "page_not_found()`` 视图生成的默认页面上。" msgid "" "The URL path is no longer displayed in the default 404 template and the " "``request_path`` context variable is now quoted to fix the issue for custom " "templates that use the path." msgstr "" "默认的 404 模板中不再显示 URL 路径,并且 ``request_path`` 上下文变量现在被引" "用起来,以解决使用路径的自定义模板的问题。" msgid "Django 1.11.19 release notes" msgstr "Django 1.11.19 版本发行说明" msgid "*February 11, 2019*" msgstr "*2019 年 2 月 11 日*" msgid "Django 1.11.19 fixes a security issue in 1.11.18." msgstr "Django 1.11.19 修复了 1.11.18 中的一个安全问题。" msgid "" "CVE-2019-6975: Memory exhaustion in ``django.utils.numberformat.format()``" msgstr "" "CVE-2019-6975: ``django.utils.numberformat.format()`` 中的内存耗尽问题。" msgid "" "If ``django.utils.numberformat.format()`` -- used by ``contrib.admin`` as " "well as the ``floatformat``, ``filesizeformat``, and ``intcomma`` templates " "filters -- received a ``Decimal`` with a large number of digits or a large " "exponent, it could lead to significant memory usage due to a call to ``'{:" "f}'.format()``." msgstr "" "如果 ``django.utils.numberformat.format()`` -- 被 ``contrib.admin`` 以及 " "``floatformat``、``filesizeformat`` 和 ``intcomma`` 模板过滤器使用 -- 收到具" "有大量数字或大指数的 ``Decimal``,它可能会导致由于调用 ``'{:f}'.format()`` 而" "导致显著的内存使用。" msgid "" "To avoid this, decimals with more than 200 digits are now formatted using " "scientific notation." msgstr "为避免这种情况,现在使用科学记数法格式化超过 200 位数的小数。" msgid "Django 1.11.2 release notes" msgstr "Django 1.11.2 版本发行说明" msgid "*June 1, 2017*" msgstr "*2017 年 6 月 1 日*" msgid "" "Django 1.11.2 adds a minor feature and fixes several bugs in 1.11.1. Also, " "the latest string translations from Transifex are incorporated." msgstr "" "Django 1.11.2 在 1.11.1 的基础上增加了一个小功能,并修复了一些错误。此外,还" "整合了来自 Transifex 的最新字符串翻译。" msgid "Minor feature" msgstr "次要特性" msgid "" "The new ``LiveServerTestCase.port`` attribute reallows the use case of " "binding to a specific port following the :ref:`bind to port zero " "` change in Django 1.11." msgstr "" "新的 ``LiveServerTestCase.port`` 属性重新允许绑定到特定端口的用例,这是自 " "Django 1.11 中的 :ref:`绑定到零端口 ` 更" "改后的情况。" msgid "" "Added detection for GDAL 2.1 and 2.0, and removed detection for unsupported " "versions 1.7 and 1.8 (:ticket:`28181`)." msgstr "" "已添加对 GDAL 2.1 和 2.0 的检测,并移除了不支持的版本 1.7 和 1.8 的检测 (:" "ticket:`28181`)。" msgid "" "Changed ``contrib.gis`` to raise ``ImproperlyConfigured`` rather than " "``GDALException`` if ``gdal`` isn't installed, to allow third-party apps to " "catch that exception (:ticket:`28178`)." msgstr "" "已更改 ``contrib.gis``,如果未安装 ``gdal``,则引发 ``ImproperlyConfigured`` " "而不是 ``GDALException``,以允许第三方应用程序捕获该异常 (:ticket:`28178`)。" msgid "" "Fixed ``django.utils.http.is_safe_url()`` crash on invalid IPv6 URLs (:" "ticket:`28142`)." msgstr "" "修复了在无效的 IPv6 URL 上导致 ``django.utils.http.is_safe_url()`` 崩溃的问" "题 (:ticket:`28142`)。" msgid "" "Fixed regression causing pickling of model fields to crash (:ticket:`28188`)." msgstr "修复了导致模型字段的 pickle 操作崩溃的退化问题 (:ticket:`28188`)。" msgid "" "Fixed ``django.contrib.auth.authenticate()`` when multiple authentication " "backends don't accept a positional ``request`` argument (:ticket:`28207`)." msgstr "" "修复了 ``django.contrib.auth.authenticate()`` 当多个身份验证后端不接受位置参" "数的 ``request`` 时的问题 (:ticket:`28207`)。" msgid "" "Fixed introspection of index field ordering on PostgreSQL (:ticket:`28197`)." msgstr "修复了对 PostgreSQL 上索引字段排序的内省问题 (:ticket:`28197`)。" msgid "" "Fixed a regression where ``Model._state.adding`` wasn't set correctly on " "multi-table inheritance parent models after saving a child model (:ticket:" "`28210`)." msgstr "" "修复了在保存子模型后,多表继承父模型上未正确设置 ``Model._state.adding`` 的退" "化问题 (:ticket:`28210`)。" msgid "" "Allowed ``DjangoJSONEncoder`` to serialize ``django.utils.deprecation." "CallableBool`` (:ticket:`28230`)." msgstr "" "允许 ``DjangoJSONEncoder`` 序列化 ``django.utils.deprecation.CallableBool`` " "(:ticket:`28230`)。" msgid "" "Relaxed the validation added in Django 1.11 of the fields in the " "``defaults`` argument of ``QuerySet.get_or_create()`` and " "``update_or_create()`` to reallow settable model properties (:ticket:" "`28222`)." msgstr "" "放宽了在 Django 1.11 中添加到 ``QuerySet.get_or_create()`` 和 " "``update_or_create()`` 的 ``defaults`` 参数中字段的验证,以允许重新设置可设置" "的模型属性 (:ticket:`28222`)。" msgid "" "Fixed ``MultipleObjectMixin.paginate_queryset()`` crash on Python 2 if the " "``InvalidPage`` message contains non-ASCII (:ticket:`28204`)." msgstr "" "修复了在 Python 2 上,如果 ``InvalidPage`` 消息包含非 ASCII 字符,则导致 " "``MultipleObjectMixin.paginate_queryset()`` 崩溃的问题 (:ticket:`28204`)。" msgid "" "Prevented ``Subquery`` from adding an unnecessary ``CAST`` which resulted in " "invalid SQL (:ticket:`28199`)." msgstr "" "防止 ``Subquery`` 添加不必要的 ``CAST``,导致生成无效的 SQL (:ticket:" "`28199`)。" msgid "Corrected detection of GDAL 2.1 on Windows (:ticket:`28181`)." msgstr "已更正在 Windows 上检测 GDAL 2.1 的问题 (:ticket:`28181`)。" msgid "" "Made date-based generic views return a 404 rather than crash when given an " "out of range date (:ticket:`28209`)." msgstr "" "使基于日期的通用视图在收到超出范围的日期时返回 404 而不是崩溃 (:ticket:" "`28209`)。" msgid "" "Fixed a regression where ``file_move_safe()`` crashed when moving files to a " "CIFS mount (:ticket:`28170`)." msgstr "" "修复了 ``file_move_safe()`` 在将文件移动到 CIFS 挂载点时崩溃的退化问题 (:" "ticket:`28170`)。" msgid "" "Moved the ``ImageField`` file extension validation added in Django 1.11 from " "the model field to the form field to reallow the use case of storing images " "without an extension (:ticket:`28242`)." msgstr "" "将 Django 1.11 中添加的 ``ImageField`` 文件扩展名验证从模型字段移到表单字段," "以允许存储没有扩展名的图像的用例 (:ticket:`28242`)。" msgid "Django 1.11.20 release notes" msgstr "Django 1.11.20 版本发行说明" msgid "Django 1.11.20 fixes a packaging error in 1.11.19." msgstr "Django 1.11.20 修复了 1.11.19 中的一个打包错误。" msgid "Corrected packaging error from 1.11.19 (:ticket:`30175`)." msgstr "已纠正了来自 1.11.19 的打包错误 (:ticket:`30175`)。" msgid "Django 1.11.21 release notes" msgstr "Django 1.11.21 版本发行说明" msgid "*June 3, 2019*" msgstr "*2019 年 6 月 3 日*" msgid "Django 1.11.21 fixes a security issue in 1.11.20." msgstr "Django 1.11.21 修复了 1.11.20 中的一个安全问题。" msgid "CVE-2019-12308: AdminURLFieldWidget XSS" msgstr "CVE-2019-12308 : AdminURLFieldWidget 跨站脚本攻击(XSS)" msgid "" "The clickable \"Current URL\" link generated by ``AdminURLFieldWidget`` " "displayed the provided value without validating it as a safe URL. Thus, an " "unvalidated value stored in the database, or a value provided as a URL query " "parameter payload, could result in an clickable JavaScript link." msgstr "" "由 ``AdminURLFieldWidget`` 生成的可点击的 \"当前 URL\" 链接显示了提供的值,而" "没有将其验证为安全的 URL。因此,存储在数据库中的未经验证的值,或者作为 URL 查" "询参数有效载荷提供的值,都可能导致可点击的 JavaScript 链接。" msgid "" "``AdminURLFieldWidget`` now validates the provided value using :class:" "`~django.core.validators.URLValidator` before displaying the clickable link. " "You may customize the validator by passing a ``validator_class`` kwarg to " "``AdminURLFieldWidget.__init__()``, e.g. when using :attr:`~django.contrib." "admin.ModelAdmin.formfield_overrides`." msgstr "" "现在,在显示可点击链接之前,``AdminURLFieldWidget`` 使用 :class:`~django." "core.validators.URLValidator` 对提供的值进行验证。您可以通过将 " "``validator_class`` 关键字参数传递给 ``AdminURLFieldWidget.__init__()`` 来自" "定义验证器,例如在使用 :attr:`~django.contrib.admin.ModelAdmin." "formfield_overrides` 时。" msgid "Django 1.11.22 release notes" msgstr "Django 1.11.22 版本发行说明" msgid "*July 1, 2019*" msgstr "*2019 年 7 月 1 日*" msgid "Django 1.11.22 fixes a security issue in 1.11.21." msgstr "Django 1.11.22 修复了 1.11.21 中的一个安全问题。" msgid "" "CVE-2019-12781: Incorrect HTTP detection with reverse-proxy connecting via " "HTTPS" msgstr "CVE-2019-12781 :通过 HTTPS 连接的反向代理中,HTTP 检测不正确。" msgid "" "When deployed behind a reverse-proxy connecting to Django via HTTPS, :attr:" "`django.http.HttpRequest.scheme` would incorrectly detect client requests " "made via HTTP as using HTTPS. This entails incorrect results for :meth:" "`~django.http.HttpRequest.is_secure`, and :meth:`~django.http.HttpRequest." "build_absolute_uri`, and that HTTP requests would not be redirected to HTTPS " "in accordance with :setting:`SECURE_SSL_REDIRECT`." msgstr "" "当部署在反向代理后面,通过 HTTPS 连接到 Django 时,:attr:`django.http." "HttpRequest.scheme` 会错误地将客户端通过 HTTP 发送的请求检测为使用 HTTPS。这" "导致了 :meth:`~django.http.HttpRequest.is_secure` 和 :meth:`~django.http." "HttpRequest.build_absolute_uri` 的不正确结果,以及 HTTP 请求不会根据 :" "setting:`SECURE_SSL_REDIRECT` 进行重定向到 HTTPS。" msgid "" "``HttpRequest.scheme`` now respects :setting:`SECURE_PROXY_SSL_HEADER`, if " "it is configured, and the appropriate header is set on the request, for both " "HTTP and HTTPS requests." msgstr "" "现在,``HttpRequest.scheme`` 会根据配置的 :setting:" "`SECURE_PROXY_SSL_HEADER`,如果已配置,并且请求上设置了适当的标头,对于 HTTP " "和 HTTPS 请求都会进行相应的处理。" msgid "" "If you deploy Django behind a reverse-proxy that forwards HTTP requests, and " "that connects to Django via HTTPS, be sure to verify that your application " "correctly handles code paths relying on ``scheme``, ``is_secure()``, " "``build_absolute_uri()``, and ``SECURE_SSL_REDIRECT``." msgstr "" "如果您在反向代理后面部署 Django,该代理转发 HTTP 请求并通过 HTTPS 连接到 " "Django,请确保验证您的应用程序正确处理依赖于 ``scheme``、``is_secure()``、" "``build_absolute_uri()`` 和 ``SECURE_SSL_REDIRECT`` 的代码路径。" msgid "Django 1.11.23 release notes" msgstr "Django 1.11.23 版本发行说明" msgid "*August 1, 2019*" msgstr "*2019 年 8 月 1 日*" msgid "Django 1.11.23 fixes security issues in 1.11.22." msgstr "Django 1.11.23 修复了 1.11.22 中的安全问题。" msgid "" "CVE-2019-14232: Denial-of-service possibility in ``django.utils.text." "Truncator``" msgstr "" "CVE-2019-14232: ``django.utils.text.Truncator`` 中存在拒绝服务可能性问题。" msgid "" "If ``django.utils.text.Truncator``'s ``chars()`` and ``words()`` methods " "were passed the ``html=True`` argument, they were extremely slow to evaluate " "certain inputs due to a catastrophic backtracking vulnerability in a regular " "expression. The ``chars()`` and ``words()`` methods are used to implement " "the :tfilter:`truncatechars_html` and :tfilter:`truncatewords_html` template " "filters, which were thus vulnerable." msgstr "" "如果 ``django.utils.text.Truncator`` 的 ``chars()`` 和 ``words()`` 方法传递" "了 ``html=True`` 参数,它们在处理某些输入时非常慢,这是由于正则表达式中的灾难" "性回溯漏洞引起的。``chars()`` 和 ``words()`` 方法用于实现 :tfilter:" "`truncatechars_html` 和 :tfilter:`truncatewords_html` 模板过滤器,因此这两个" "过滤器也存在漏洞。" msgid "" "The regular expressions used by ``Truncator`` have been simplified in order " "to avoid potential backtracking issues. As a consequence, trailing " "punctuation may now at times be included in the truncated output." msgstr "" "为了避免潜在的回溯问题,``Truncator`` 使用的正则表达式已经简化。因此,尾部的" "标点符号可能会有时包含在截断后的输出中。" msgid "CVE-2019-14233: Denial-of-service possibility in ``strip_tags()``" msgstr "CVE-2019-14233: ``strip_tags()`` 中存在拒绝服务可能性问题。" msgid "" "Due to the behavior of the underlying ``HTMLParser``, :func:`django.utils." "html.strip_tags` would be extremely slow to evaluate certain inputs " "containing large sequences of nested incomplete HTML entities. The " "``strip_tags()`` method is used to implement the corresponding :tfilter:" "`striptags` template filter, which was thus also vulnerable." msgstr "" "由于底层的 ``HTMLParser`` 的行为,:func:`django.utils.html.strip_tags` 在处理" "包含大量嵌套不完整 HTML 实体序列的某些输入时会变得非常慢。``strip_tags()`` 方" "法用于实现相应的 :tfilter:`striptags` 模板过滤器,因此这两个过滤器也存在漏" "洞。" msgid "" "``strip_tags()`` now avoids recursive calls to ``HTMLParser`` when progress " "removing tags, but necessarily incomplete HTML entities, stops being made." msgstr "" "现在,``strip_tags()`` 在删除标签时避免了对 ``HTMLParser`` 的递归调用,但当进" "度停止删除标签但仍存在不完整的 HTML 实体时,它会继续运行。" msgid "" "Remember that absolutely NO guarantee is provided about the results of " "``strip_tags()`` being HTML safe. So NEVER mark safe the result of a " "``strip_tags()`` call without escaping it first, for example with :func:" "`django.utils.html.escape`." msgstr "" "请记住,``strip_tags()`` 的结果绝对不保证是安全的 HTML。因此,在将 " "``strip_tags()`` 调用的结果标记为安全之前,绝对不要忘记首先进行转义,例如使" "用 :func:`django.utils.html.escape`。" msgid "" "CVE-2019-14234: SQL injection possibility in key and index lookups for " "``JSONField``/``HStoreField``" msgstr "" "CVE-2019-14234: 在 ``JSONField``/``HStoreField`` 的键和索引查找中存在 SQL 注" "入可能性。" msgid "" ":lookup:`Key and index lookups ` for ``django.contrib." "postgres.fields.JSONField`` and :lookup:`key lookups ` for :" "class:`~django.contrib.postgres.fields.HStoreField` were subject to SQL " "injection, using a suitably crafted dictionary, with dictionary expansion, " "as the ``**kwargs`` passed to ``QuerySet.filter()``." msgstr "" "``django.contrib.postgres.fields.JSONField`` 的 :lookup:`键和索引查找 " "`,以及 :class:`~django.contrib.postgres.fields.HStoreField` " "的 :lookup:`键查找 `,都受到了 SQL 注入的影响,使用适当构造" "的字典,并将其作为传递给 ``QuerySet.filter()`` 的 ``**kwargs`` 进行字典扩展。" msgid "" "CVE-2019-14235: Potential memory exhaustion in ``django.utils.encoding." "uri_to_iri()``" msgstr "" "CVE-2019-14235: ``django.utils.encoding.uri_to_iri()`` 中存在潜在的内存耗尽问" "题。" msgid "" "If passed certain inputs, :func:`django.utils.encoding.uri_to_iri` could " "lead to significant memory usage due to excessive recursion when re-percent-" "encoding invalid UTF-8 octet sequences." msgstr "" "如果传递了特定的输入,:func:`django.utils.encoding.uri_to_iri` 在重新百分号编" "码无效的 UTF-8 八位序列时可能会导致显着的内存使用,因为它会发生过多的递归。" msgid "" "``uri_to_iri()`` now avoids recursion when re-percent-encoding invalid UTF-8 " "octet sequences." msgstr "" "现在,``uri_to_iri()`` 在重新百分号编码无效的 UTF-8 八位序列时避免了递归。" msgid "Django 1.11.24 release notes" msgstr "Django 1.11.24 版本发行说明" msgid "*September 2, 2019*" msgstr "*2019 年 9 月 2 日*" msgid "Django 1.11.24 fixes a regression in 1.11.23." msgstr "Django 1.11.24 修复了 1.11.23 中的一个缺陷。" msgid "" "Fixed crash of ``KeyTransform()`` for ``django.contrib.postgres.fields." "JSONField`` and :class:`~django.contrib.postgres.fields.HStoreField` when " "using on expressions with params (:ticket:`30672`)." msgstr "" "修复了在使用带参数的表达式时,``KeyTransform()`` 对于 ``django.contrib." "postgres.fields.JSONField`` 和 :class:`~django.contrib.postgres.fields." "HStoreField` 的崩溃问题 (:ticket:`30672`)。" msgid "Django 1.11.25 release notes" msgstr "Django 1.11.25 版本发行说明" msgid "*October 1, 2019*" msgstr "*2019 年 10 月 1 日*" msgid "Django 1.11.25 fixes a regression in 1.11.23." msgstr "Django 1.11.25 修复了 1.11.23 中的一个缺陷。" msgid "" "Fixed a crash when filtering with a ``Subquery()`` annotation of a queryset " "containing ``django.contrib.postgres.fields.JSONField`` or :class:`~django." "contrib.postgres.fields.HStoreField` (:ticket:`30769`)." msgstr "" "修复了在使用包含 ``django.contrib.postgres.fields.JSONField`` 或 :class:" "`~django.contrib.postgres.fields.HStoreField` 的 queryset 的 ``Subquery()`` " "注释进行筛选时的崩溃问题 (:ticket:`30769`)。" msgid "Django 1.11.26 release notes" msgstr "Django 1.11.26 版本发行说明" msgid "*November 4, 2019*" msgstr "*2019 年 11 月 4 日*" msgid "Django 1.11.26 fixes a regression in 1.11.25." msgstr "Django 1.11.26 修复了 1.11.25 中的一个缺陷。" msgid "" "Fixed a crash when using a ``contains``, ``contained_by``, ``has_key``, " "``has_keys``, or ``has_any_keys`` lookup on ``django.contrib.postgres.fields." "JSONField``, if the right or left hand side of an expression is a key " "transform (:ticket:`30826`)." msgstr "" "修复了在 ``django.contrib.postgres.fields.JSONField`` 上使用 ``contains``、" "``contained_by``、``has_key``、``has_keys`` 或 ``has_any_keys`` 查找时的崩溃" "问题,如果表达式的左侧或右侧是键转换 (:ticket:`30826`)。" msgid "Django 1.11.27 release notes" msgstr "Django 1.11.27 版本发行说明" msgid "*December 18, 2019*" msgstr "*2019 年 12 月 18 日*" msgid "Django 1.11.27 fixes a security issue and a data loss bug in 1.11.26." msgstr "Django 1.11.27 修复了 1.11.26 中的一个安全问题和一个数据丢失漏洞。" msgid "CVE-2019-19844: Potential account hijack via password reset form" msgstr "CVE-2019-19844 :通过密码重置表单可能导致账户劫持" msgid "" "By submitting a suitably crafted email address making use of Unicode " "characters, that compared equal to an existing user email when lower-cased " "for comparison, an attacker could be sent a password reset token for the " "matched account." msgstr "" "通过提交一个精心设计的电子邮件地址,利用 Unicode 字符使其与现有用户电子邮件在" "进行比较时转换为小写后相等,攻击者可以为匹配的帐户发送密码重置令牌。" msgid "" "In order to avoid this vulnerability, password reset requests now compare " "the submitted email using the stricter, recommended algorithm for case-" "insensitive comparison of two identifiers from `Unicode Technical Report 36, " "section 2.11.2(B)(2)`__. Upon a match, the email containing the reset token " "will be sent to the email address on record rather than the submitted " "address." msgstr "" "为了避免这个漏洞,密码重置请求现在使用更严格、推荐的算法来比较提交的电子邮" "件,用于不区分大小写比较两个标识符的算法来自 `Unicode Technical Report 36, " "section 2.11.2(B)(2)`__。如果匹配成功,包含重置令牌的电子邮件将发送到记录的电" "子邮件地址,而不是提交的地址。" msgid "" "Fixed a data loss possibility in :class:`~django.contrib.postgres.forms." "SplitArrayField`. When using with ``ArrayField(BooleanField())``, all values " "after the first ``True`` value were marked as checked instead of preserving " "passed values (:ticket:`31073`)." msgstr "" "修复了 :class:`~django.contrib.postgres.forms.SplitArrayField` 中的数据丢失可" "能性。当与 ``ArrayField(BooleanField())`` 一起使用时,第一个 ``True`` 值后的" "所有值都被标记为已选中,而不是保留传递的值 (:ticket:`31073`)。" msgid "Django 1.11.28 release notes" msgstr "Django 1.11.28 版本发行说明" msgid "*February 3, 2020*" msgstr "*2020 年 2 月 3 日*" msgid "Django 1.11.28 fixes a security issue in 1.11.27." msgstr "Django 1.11.28 修复了 1.11.27 中的一个安全问题。" msgid "CVE-2020-7471: Potential SQL injection via ``StringAgg(delimiter)``" msgstr "CVE-2020-7471: 通过 ``StringAgg(delimiter)`` 可能存在 SQL 注入风险。" msgid "" ":class:`~django.contrib.postgres.aggregates.StringAgg` aggregation function " "was subject to SQL injection, using a suitably crafted ``delimiter``." msgstr "" ":class:`~django.contrib.postgres.aggregates.StringAgg` 聚合函数存在 SQL 注入" "风险,使用适当构造的 ``delimiter``。" msgid "Django 1.11.29 release notes" msgstr "Django 1.11.29 版本发行说明" msgid "*March 4, 2020*" msgstr "*2020 年 3 月 4 日*" msgid "Django 1.11.29 fixes a security issue in 1.11.28." msgstr "Django 1.11.29 修复了 1.11.28 中的一个安全问题。" msgid "" "CVE-2020-9402: Potential SQL injection via ``tolerance`` parameter in GIS " "functions and aggregates on Oracle" msgstr "" "CVE-2020-9402: 在 Oracle 上的 GIS 函数和聚合中,通过 ``tolerance`` 参数可能存" "在 SQL 注入风险。" msgid "" "GIS functions and aggregates on Oracle were subject to SQL injection, using " "a suitably crafted ``tolerance``." msgstr "" "在 Oracle 上的 GIS 函数和聚合存在 SQL 注入风险,使用适当构造的 " "``tolerance``。" msgid "Django 1.11.3 release notes" msgstr "Django 1.11.3 版本发行说明" msgid "*July 1, 2017*" msgstr "*2017 年 7 月 1 日*" msgid "Django 1.11.3 fixes several bugs in 1.11.2." msgstr "Django 1.11.3 修复了 1.11.2 中的几个漏洞。" msgid "" "Removed an incorrect deprecation warning about a missing ``renderer`` " "argument if a ``Widget.render()`` method accepts ``**kwargs`` (:ticket:" "`28265`)." msgstr "" "移除了关于如果 ``Widget.render()`` 方法接受 ``**kwargs`` 则缺少 ``renderer`` " "参数的不正确弃用警告 (:ticket:`28265`)。" msgid "" "Fixed a regression causing ``Model.__init__()`` to crash if a field has an " "instance only descriptor (:ticket:`28269`)." msgstr "" "修复了导致如果一个字段具有实例特定的描述符,则 ``Model.__init__()`` 崩溃的退" "化问题 (:ticket:`28269`)。" msgid "" "Fixed an incorrect ``DisallowedModelAdminLookup`` exception when using a " "nested reverse relation in ``list_filter`` (:ticket:`28262`)." msgstr "" "修复了在 ``list_filter`` 中使用嵌套的反向关系时出现的不正确的 " "``DisallowedModelAdminLookup`` 异常 (:ticket:`28262`)。" msgid "" "Fixed admin's ``FieldListFilter.get_queryset()`` crash on invalid input (:" "ticket:`28202`)." msgstr "" "修复了在管理员的 ``FieldListFilter.get_queryset()`` 上输入无效数据时的崩溃问" "题 (:ticket:`28202`)。" msgid "" "Fixed invalid HTML for a required ``AdminFileWidget`` (:ticket:`28278`)." msgstr "" "修复了对于必填的 ``AdminFileWidget`` 生成的无效 HTML (:ticket:`28278`)。" msgid "" "Fixed model initialization to set the name of class-based model indexes for " "models that only inherit ``models.Model`` (:ticket:`28282`)." msgstr "" "修复了对于仅继承 ``models.Model`` 的模型,设置基于类的模型索引的名称的模型初" "始化问题 (:ticket:`28282`)。" msgid "" "Fixed crash in admin's inlines when a model has an inherited non-editable " "primary key (:ticket:`27967`)." msgstr "" "修复了在模型具有继承的不可编辑主键时,管理员中的内联出现崩溃的问题 (:ticket:" "`27967`)。" msgid "" "Fixed ``QuerySet.union()``, ``intersection()``, and ``difference()`` when " "combining with an ``EmptyQuerySet`` (:ticket:`28293`)." msgstr "" "修复了在与 ``EmptyQuerySet`` 结合使用时,``QuerySet.union()``, " "``intersection()``, 和 ``difference()`` 的问题 (:ticket:`28293`)。" msgid "" "Prevented ``Paginator``’s unordered object list warning from evaluating a " "``QuerySet`` (:ticket:`28284`)." msgstr "" "防止 ``Paginator`` 的无序对象列表警告评估 ``QuerySet`` (:ticket:`28284`)。" msgid "" "Fixed the value of ``redirect_field_name`` in ``LoginView``’s template " "context. It's now an empty string (as it is for the original function-based " "``login()`` view) if the corresponding parameter isn't sent in a request (in " "particular, when the login page is accessed directly) (:ticket:`28229`)." msgstr "" "修复了在 ``LoginView`` 的模板上下文中 ``redirect_field_name`` 的值。现在,如" "果请求中没有发送相应的参数(特别是当直接访问登录页面时),它现在是一个空字符" "串(与原始的基于函数的 ``login()`` 视图一样) (:ticket:`28229`)。" msgid "" "Prevented attribute values in the ``django/forms/widgets/attrs.html`` " "template from being localized so that numeric attributes (e.g. ``max`` and " "``min``) of ``NumberInput`` work correctly (:ticket:`28303`)." msgstr "" "防止在 ``django/forms/widgets/attrs.html`` 模板中本地化属性值,以便 " "``NumberInput`` 的数字属性(例如 ``max`` 和 ``min``)可以正常工作 (:ticket:" "`28303`)。" msgid "" "Removed casting of the option value to a string in the template context of " "the ``CheckboxSelectMultiple``, ``NullBooleanSelect``, ``RadioSelect``, " "``SelectMultiple``, and ``Select`` widgets (:ticket:`28176`). In Django " "1.11.1, casting was added in Python to avoid localization of numeric values " "in Django templates, but this made some use cases more difficult. Casting is " "now done in the template using the ``|stringformat:'s'`` filter." msgstr "" "在 ``CheckboxSelectMultiple``、``NullBooleanSelect``、``RadioSelect``、" "``SelectMultiple`` 和 ``Select`` 小部件的模板上下文中删除了选项值转换为字符串" "的操作 (:ticket:`28176`)。在 Django 1.11.1 中,Python 中添加了转换以避免 " "Django 模板中的数字值本地化,但这使某些用例变得更加困难。现在在模板中使用 ``|" "stringformat:'s'`` 过滤器进行转换。" msgid "" "Prevented a primary key alteration from adding a foreign key constraint if " "``db_constraint=False`` (:ticket:`28298`)." msgstr "" "如果 ``db_constraint=False``,则防止主键更改添加外键约束 (:ticket:`28298`)。" msgid "" "Fixed ``UnboundLocalError`` crash in ``RenameField`` with nonexistent field " "(:ticket:`28350`)." msgstr "" "修复了在不存在的字段上的 ``RenameField`` 中的 ``UnboundLocalError`` 崩溃问题 " "(:ticket:`28350`)。" msgid "" "Fixed a regression preventing a model field's ``limit_choices_to`` from " "being evaluated when a ``ModelForm`` is instantiated (:ticket:`28345`)." msgstr "" "修复了在实例化 ``ModelForm`` 时防止模型字段的 ``limit_choices_to`` 被评估的回" "归问题 (:ticket:`28345`)。" msgid "Django 1.11.4 release notes" msgstr "Django 1.11.4 版本发行说明" msgid "*August 1, 2017*" msgstr "*2017 年 8 月 1 日*" msgid "Django 1.11.4 fixes several bugs in 1.11.3." msgstr "Django 1.11.4 修复了 1.11.3 中的几个漏洞。" msgid "" "Fixed a regression in 1.11.3 on Python 2 where non-ASCII ``format`` values " "for date/time widgets results in an empty ``value`` in the widget's HTML (:" "ticket:`28355`)." msgstr "" "修复了在 Python 2 上的 1.11.3 中的回归问题,其中对于日期/时间小部件的非 " "ASCII ``format`` 值导致小部件的 HTML 中出现空的 ``value`` (:ticket:`28355`)。" msgid "" "Fixed ``QuerySet.union()`` and ``difference()`` when combining with a " "queryset raising ``EmptyResultSet`` (:ticket:`28378`)." msgstr "" "修复了与引发 ``EmptyResultSet`` 的查询集组合时的 ``QuerySet.union()`` 和 " "``difference()`` 的问题 (:ticket:`28378`)。" msgid "" "Fixed a regression in pickling of ``LazyObject`` on Python 2 when the " "wrapped object doesn't have ``__reduce__()`` (:ticket:`28389`)." msgstr "" "修复了在 Python 2 上的 ``LazyObject`` 的 pickling 回归问题,当封装的对象没有 " "``__reduce__()`` 时 (:ticket:`28389`)。" msgid "" "Fixed crash in ``runserver``'s ``autoreload`` with Python 2 on Windows with " "non-``str`` environment variables (:ticket:`28174`)." msgstr "" "修复了在 Windows 上使用 Python 2,并且环境变量不是 ``str`` 类型时,导致 " "``runserver`` 的 ``autoreload`` 崩溃的问题 (:ticket:`28174`)。" msgid "" "Corrected ``Field.has_changed()`` to return ``False`` for disabled form " "fields: ``BooleanField``, ``MultipleChoiceField``, ``MultiValueField``, " "``FileField``, ``ModelChoiceField``, and ``ModelMultipleChoiceField``." msgstr "" "已更正 ``Field.has_changed()``,使其对于禁用的表单字段(如 ``BooleanField``、" "``MultipleChoiceField``、``MultiValueField``、``FileField``、" "``ModelChoiceField`` 和 ``ModelMultipleChoiceField``)返回 ``False``。" msgid "" "Fixed ``QuerySet.count()`` for ``union()``, ``difference()``, and " "``intersection()`` queries. (:ticket:`28399`)." msgstr "" "修复了 ``union()``, ``difference()`` 和 ``intersection()`` 查询的 ``QuerySet." "count()`` 方法 (:ticket:`28399`)。" msgid "" "Fixed ``ClearableFileInput`` rendering as a subwidget of ``MultiWidget`` (:" "ticket:`28414`). Custom ``clearable_file_input.html`` widget templates will " "need to adapt for the fact that context values ``checkbox_name``, " "``checkbox_id``, ``is_initial``, ``input_text``, ``initial_text``, and " "``clear_checkbox_label`` are now attributes of ``widget`` rather than " "appearing in the top-level context." msgstr "" "修复了 ``ClearableFileInput`` 以 ``MultiWidget`` 的子小部件形式呈现的问题 (:" "ticket:`28414`)。自定义的 ``clearable_file_input.html`` 小部件模板需要适应这" "样的事实,即上下文值 ``checkbox_name``、``checkbox_id``、``is_initial``、" "``input_text``、``initial_text`` 和 ``clear_checkbox_label`` 现在是 " "``widget`` 的属性,而不是出现在顶级上下文中。" msgid "" "Fixed queryset crash when using a ``GenericRelation`` to a proxy model (:" "ticket:`28418`)." msgstr "" "修复了在使用 ``GenericRelation`` 到代理模型时,查询集崩溃的问题 (:ticket:" "`28418`)。" msgid "Django 1.11.5 release notes" msgstr "Django 1.11.5 版本发行说明" msgid "Django 1.11.5 fixes a security issue and several bugs in 1.11.4." msgstr "Django 1.11.5 修复了 1.11.4 中的一个安全问题和几个漏洞。" msgid "" "Fixed GEOS version parsing if the version has a commit hash at the end (new " "in GEOS 3.6.2) (:ticket:`28441`)." msgstr "" "修复了如果 GEOS 版本在末尾具有提交哈希(在 GEOS 3.6.2 中新引入)时的版本解析" "问题 (:ticket:`28441`)。" msgid "Added compatibility for ``cx_Oracle`` 6 (:ticket:`28498`)." msgstr "添加了对 ``cx_Oracle`` 6 的兼容性 (:ticket:`28498`)。" msgid "" "Fixed select widget rendering when option values are tuples (:ticket:" "`28502`)." msgstr "修复了当选项值为元组时,选择小部件的呈现问题 (:ticket:`28502`)。" msgid "" "Django 1.11 inadvertently changed the sequence and trigger naming scheme on " "Oracle. This causes errors on INSERTs for some tables if " "``'use_returning_into': False`` is in the ``OPTIONS`` part of ``DATABASES``. " "The pre-1.11 naming scheme is now restored. Unfortunately, it necessarily " "requires an update to Oracle tables created with Django 1.11.[1-4]. Use the " "upgrade script in :ticket:`28451` comment 8 to update sequence and trigger " "names to use the pre-1.11 naming scheme." msgstr "" "Django 1.11 无意中改变了 Oracle 上的序列和触发器命名方案。如果在 " "``DATABASES`` 的 ``OPTIONS`` 部分中包含 ``'use_returning_into': False``,这会" "导致一些表的插入操作出错。现在已经恢复了 1.11 之前的命名方案。不幸的是,这必" "然需要更新使用 Django 1.11.[1-4] 创建的 Oracle 表。可以使用 :ticket:`28451` " "评论 8 中的升级脚本来更新序列和触发器的名称,以使用 1.11 之前的命名方案。" msgid "" "Added POST request support to ``LogoutView``, for equivalence with the " "function-based ``logout()`` view (:ticket:`28513`)." msgstr "" "为了与基于函数的 ``logout()`` 视图相等,为 ``LogoutView`` 添加了 POST 请求支" "持 (:ticket:`28513`)。" msgid "" "Omitted ``pages_per_range`` from ``BrinIndex.deconstruct()`` if it's " "``None`` (:ticket:`25809`)." msgstr "" "如果 ``pages_per_range`` 为 ``None``,则在 ``BrinIndex.deconstruct()`` 中省略" "了它 (:ticket:`25809`)。" msgid "" "Fixed a regression where ``SelectDateWidget`` localized the years in the " "select box (:ticket:`28530`)." msgstr "" "修复了 ``SelectDateWidget`` 本地化选择框中的年份的回归问题 (:ticket:" "`28530`)。" msgid "" "Fixed a regression in 1.11.4 where ``runserver`` crashed with non-Unicode " "system encodings on Python 2 + Windows (:ticket:`28487`)." msgstr "" "修复了在 Python 2 + Windows 上使用非 Unicode 系统编码时,1.11.4 中的 " "``runserver`` 崩溃的回归问题 (:ticket:`28487`)。" msgid "" "Fixed a regression in Django 1.10 where changes to a ``ManyToManyField`` " "weren't logged in the admin change history (:ticket:`27998`) and prevented " "``ManyToManyField`` initial data in model forms from being affected by " "subsequent model changes (:ticket:`28543`)." msgstr "" "修复了 Django 1.10 中的回归问题,其中对 ``ManyToManyField`` 的更改未在管理员" "更改历史中记录 (:ticket:`27998`),并防止模型表单中的 ``ManyToManyField`` 初始" "数据受到后续模型更改的影响 (:ticket:`28543`)。" msgid "" "Fixed non-deterministic results or an ``AssertionError`` crash in some " "queries with multiple joins (:ticket:`26522`)." msgstr "" "修复了在某些具有多个连接的查询中产生非确定性结果或引发 ``AssertionError`` 崩" "溃的问题 (:ticket:`26522`)。" msgid "" "Fixed a regression in ``contrib.auth``'s ``login()`` and ``logout()`` views " "where they ignored positional arguments (:ticket:`28550`)." msgstr "" "修复了 ``contrib.auth`` 中的 ``login()`` 和 ``logout()`` 视图中的回归问题,它" "们忽略了位置参数 (:ticket:`28550`)。" msgid "Django 1.11.6 release notes" msgstr "Django 1.11.6 版本发行说明" msgid "*October 5, 2017*" msgstr "*2017 年 10 月 5 日*" msgid "Django 1.11.6 fixes several bugs in 1.11.5." msgstr "Django 1.11.6 修复了 1.11.5 中的几个漏洞。" msgid "" "Made the ``CharField`` form field convert whitespace-only values to the " "``empty_value`` when ``strip`` is enabled (:ticket:`28555`)." msgstr "" "当启用 ``strip`` 时,使 ``CharField`` 表单字段将仅包含空白的值转换为 " "``empty_value`` (:ticket:`28555`)。" msgid "" "Fixed crash when using the name of a model's autogenerated primary key " "(``id``) in an ``Index``'s ``fields`` (:ticket:`28597`)." msgstr "" "修复了在索引的 ``fields`` 中使用模型的自动生成的主键(``id``)名称时的崩溃问" "题 (:ticket:`28597`)。" msgid "" "Fixed a regression in Django 1.9 where a custom view error handler such as " "``handler404`` that accesses ``csrf_token`` could cause CSRF verification " "failures on other pages (:ticket:`28488`)." msgstr "" "修复了 Django 1.9 中的回归问题,其中一个自定义视图错误处理程序(例如 " "``handler404``),如果访问了 ``csrf_token``,可能会导致其他页面上的 CSRF 验证" "失败 (:ticket:`28488`)。" msgid "Django 1.11.7 release notes" msgstr "Django 1.11.7 版本发行说明" msgid "*November 1, 2017*" msgstr "*2017 年 11 月 1 日*" msgid "Django 1.11.7 fixes several bugs in 1.11.6." msgstr "Django 1.11.7 修复了 1.11.6 中的几个漏洞。" msgid "" "Prevented ``cache.get_or_set()`` from caching ``None`` if the ``default`` " "argument is a callable that returns ``None`` (:ticket:`28601`)." msgstr "" "防止 ``cache.get_or_set()`` 在 ``default`` 参数是返回 ``None`` 的可调用对象时" "缓存 ``None`` (:ticket:`28601`)。" msgid "Fixed the Basque ``DATE_FORMAT`` string (:ticket:`28710`)." msgstr "修复了巴斯克语的 ``DATE_FORMAT`` 字符串 (:ticket:`28710`)。" msgid "" "Made ``QuerySet.reverse()`` affect ``nulls_first`` and ``nulls_last`` (:" "ticket:`28722`)." msgstr "" "使 ``QuerySet.reverse()`` 影响 ``nulls_first`` 和 ``nulls_last`` (:ticket:" "`28722`)。" msgid "" "Fixed unquoted table names in ``Subquery`` SQL when using ``OuterRef`` (:" "ticket:`28689`)." msgstr "" "在使用 ``OuterRef`` 时,修复了 ``Subquery`` SQL 中未引用的表名 (:ticket:" "`28689`)。" msgid "Django 1.11.8 release notes" msgstr "Django 1.11.8 版本发行说明" msgid "*December 2, 2017*" msgstr "*2017 年 12 月 2 日*" msgid "Django 1.11.8 fixes several bugs in 1.11.7." msgstr "Django 1.11.8 修复了 1.11.7 中的几个漏洞。" msgid "" "Reallowed, following a regression in Django 1.10, ``AuthenticationForm`` to " "raise the inactive user error when using ``ModelBackend`` (:ticket:`28645`)." msgstr "" "在 Django 1.10 中由于回归问题,重新允许 ``AuthenticationForm`` 在使用 " "``ModelBackend`` 时引发不活跃用户错误 (:ticket:`28645`)。" msgid "" "Added support for ``QuerySet.values()`` and ``values_list()`` for " "``union()``, ``difference()``, and ``intersection()`` queries (:ticket:" "`28781`)." msgstr "" "为 ``union()``, ``difference()`` 和 ``intersection()`` 查询添加了对 " "``QuerySet.values()`` 和 ``values_list()`` 的支持 (:ticket:`28781`)。" msgid "" "Fixed incorrect index name truncation when using a namespaced ``db_table`` (:" "ticket:`28792`)." msgstr "" "在使用命名空间的 ``db_table`` 时,修复了索引名称截断不正确的问题 (:ticket:" "`28792`)。" msgid "" "Made ``QuerySet.iterator()`` use server-side cursors on PostgreSQL after " "``values()`` and ``values_list()`` (:ticket:`28817`)." msgstr "" "在 ``values()`` 和 ``values_list()`` 之后,使 ``QuerySet.iterator()`` 在 " "PostgreSQL 上使用服务器端游标 (:ticket:`28817`)。" msgid "" "Fixed crash on SQLite and MySQL when ordering by a filtered subquery that " "uses ``nulls_first`` or ``nulls_last`` (:ticket:`28848`)." msgstr "" "在使用 ``nulls_first`` 或 ``nulls_last`` 进行排序的已过滤子查询中,在 SQLite " "和 MySQL 上修复了崩溃问题 (:ticket:`28848`)。" msgid "" "Made query lookups for ``CICharField``, ``CIEmailField``, and " "``CITextField`` use a ``citext`` cast (:ticket:`28702`)." msgstr "" "对于 ``CICharField``、``CIEmailField`` 和 ``CITextField``,使查询查找使用了 " "``citext`` 转换 (:ticket:`28702`)。" msgid "" "Fixed a regression in caching of a ``GenericForeignKey`` when the referenced " "model instance uses multi-table inheritance (:ticket:`28856`)." msgstr "" "修复了当引用的模型实例使用多表继承时,``GenericForeignKey`` 的缓存回归问题 (:" "ticket:`28856`)。" msgid "" "Fixed \"Cannot change column 'x': used in a foreign key constraint\" crash " "on MySQL with a sequence of ``AlterField`` and/or ``RenameField`` operations " "in a migration (:ticket:`28305`)." msgstr "" "在迁移中对 MySQL 进行一系列的 ``AlterField`` 和/或 ``RenameField`` 操作时,修" "复了“无法更改列 'x':在外键约束中使用”崩溃问题 (:ticket:`28305`)。" msgid "Django 1.11.9 release notes" msgstr "Django 1.11.9 版本发行说明" msgid "*January 1, 2018*" msgstr "*2018 年 1 月 1 日*" msgid "Django 1.11.9 fixes several bugs in 1.11.8." msgstr "Django 1.11.9 修复了 1.11.8 中的几个漏洞。" msgid "" "Fixed a regression in Django 1.11 that added newlines between " "``MultiWidget``'s subwidgets (:ticket:`28890`)." msgstr "" "修复了 Django 1.11 中的回归问题,该问题在 ``MultiWidget`` 的子部件之间添加了" "换行符 (:ticket:`28890`)。" msgid "" "Fixed incorrect class-based model index name generation for models with " "quoted ``db_table`` (:ticket:`28876`)." msgstr "" "修复了对带有引用的 ``db_table`` 的模型生成索引名称时的错误问题 (:ticket:" "`28876`)。" msgid "" "Fixed incorrect foreign key constraint name for models with quoted " "``db_table`` (:ticket:`28876`)." msgstr "" "修复了对带有引用的 ``db_table`` 的模型生成错误的外键约束名称问题 (:ticket:" "`28876`)。" msgid "" "Fixed a regression in caching of a ``GenericForeignKey`` when the referenced " "model instance uses more than one level of multi-table inheritance (:ticket:" "`28856`)." msgstr "" "修复了当引用的模型实例使用多级多表继承时,``GenericForeignKey`` 缓存的回归问" "题 (:ticket:`28856`)。" msgid "Django 1.2 release notes" msgstr "Django 1.2 版本发行说明" msgid "*May 17, 2010.*" msgstr "*2017 年 5 月 17 日*" msgid "Welcome to Django 1.2!" msgstr "欢迎来到 Django 1.2 版本!" msgid "" "Nearly a year in the making, Django 1.2 packs an impressive list of :ref:" "`new features ` and lots of bug fixes. These release notes " "cover the new features, as well as important changes you'll want to be aware " "of when upgrading from Django 1.1 or older versions." msgstr "" "经过近一年的努力,Django 1.2 收录了令人印象深刻的一系列 :ref:`新特性 ` 和大量的错误修复。这些发布说明涵盖了新特性,以及在从 Django 1.1 或" "更早版本升级时需要注意的重要更改。" msgid "Overview" msgstr "概况" msgid "Django 1.2 introduces several large, important new features, including:" msgstr "Django 1.2 引入了几个重要的大型新功能,包括:" msgid "" "Support for :ref:`multiple database connections ` in a single Django instance." msgstr "" "在单个 Django 实例中支持 :ref:`多个数据库连接 `。" msgid "`Model validation`_ inspired by Django's form validation." msgstr "`模型验证`_ 受到了 Django 的表单验证的启发。" msgid "" "Vastly :ref:`improved protection against Cross-Site Request Forgery " "` (CSRF)." msgstr "" "极大地 :ref:`改进了跨站点请求伪造 ` (CSRF) 的保护机" "制。" msgid "" "A new :ref:`user \"messages\" framework ` with support " "for cookie- and session-based message for both anonymous and authenticated " "users." msgstr "" "一个新的支持匿名和已验证用户的 cookie 和会话消息的 :ref:`用户“消息”框架 " "`。" msgid "" "Hooks for `object-level permissions`_, `permissions for anonymous users`_, " "and :ref:`more flexible username requirements `." msgstr "" "`对象级权限`_、`匿名用户的权限`_ 和 :ref:`更灵活的用户名要求 ` 的挂钩。" msgid "Customization of email sending via `email backends`_." msgstr "通过 `电子邮件后端`_ 自定义电子邮件发送。" msgid "" "New :ref:`\"smart\" if template tag ` which supports " "comparison operators." msgstr "" "新的 :ref:`\"智能\" if 模板标签 ` 支持比较运算符。" msgid "" "These are just the highlights; full details and a complete list of features :" "ref:`may be found below `." msgstr "" "这仅仅是亮点;完整的细节和功能列表 :ref:`可能在下面找到 `。" msgid "" "`Django Advent`_ covered the release of Django 1.2 with a series of articles " "and tutorials that cover some of the new features in depth." msgstr "" "`Django Advent`_ 用一系列的文章和教程详细介绍了 Django 1.2 版本的发布以及其中" "一些新功能。" msgid "" "Wherever possible these features have been introduced in a backwards-" "compatible manner per :doc:`our API stability policy ` " "policy." msgstr "" "尽可能地,这些功能都是按照 :doc:`我们的 API 稳定性政策 ` 来引入的,以保持向后兼容性。" msgid "" "However, a handful of features *have* changed in ways that, for some users, " "will be backwards-incompatible. The big changes are:" msgstr "" "然而,有一些功能以某种方式发生了变化,对某些用户来说将不向后兼容。主要的变化" "包括:" msgid "Support for Python 2.3 has been dropped. See the full notes below." msgstr "已取消对 Python 2.3 的支持。请参阅下面的详细说明。" msgid "" "The new CSRF protection framework is not backwards-compatible with the old " "system. Users of the old system will not be affected until the old system is " "removed in Django 1.4." msgstr "" "新的 CSRF 保护框架与旧系统不向后兼容。在 Django 1.4 中移除旧系统之前,旧系统" "的用户不会受到影响。" msgid "" "However, upgrading to the new CSRF protection framework requires a few " "important backwards-incompatible changes, detailed in `CSRF Protection`_, " "below." msgstr "" "然而,升级到新的 CSRF 保护框架需要进行一些重要的不向后兼容的更改,详细信息请" "参见下面的 `CSRF 保护`_。" msgid "" "Authors of custom :class:`~django.db.models.Field` subclasses should be " "aware that a number of methods have had a change in prototype, detailed " "under `get_db_prep_*() methods on Field`_, below." msgstr "" "自定义 :class:`~django.db.models.Field` 子类的作者应该注意,一些方法的原型发" "生了变化,详细信息请参见下面的 `Field 上的 get_db_prep_*() 方法`_。" msgid "" "The internals of template tags have changed somewhat; authors of custom " "template tags that need to store state (e.g. custom control flow tags) " "should ensure that their code follows the new rules for `stateful template " "tags`_" msgstr "" "模板标签的内部发生了一些变化;需要存储状态的自定义模板标签的作者(例如,自定" "义控制流标签)应确保他们的代码遵循了新的 `有状态模板标签`_ 的规则。" msgid "" "The :func:`~django.contrib.auth.decorators.user_passes_test`, :func:`~django." "contrib.auth.decorators.login_required`, and :func:`~django.contrib.auth." "decorators.permission_required`, decorators from :mod:`django.contrib.auth` " "only apply to functions and no longer work on methods. There's a simple one-" "line fix :ref:`detailed below `." msgstr "" "来自 :mod:`django.contrib.auth` 的 :func:`~django.contrib.auth.decorators." "user_passes_test`、:func:`~django.contrib.auth.decorators.login_required` " "和 :func:`~django.contrib.auth.decorators.permission_required` 装饰器仅适用于" "函数,不再适用于方法。有一个简单的一行修复方法,详细信息请参见下面的 :ref:`详" "细说明 `。" msgid "" "Again, these are just the big features that will affect the most users. " "Users upgrading from previous versions of Django are heavily encouraged to " "consult the complete list of :ref:`backwards-incompatible changes ` and the list of :ref:`deprecated features " "`." msgstr "" "再次强调,这些只是会影响大多数用户的主要功能。从以前版本的 Django 升级的用户" "强烈建议查看完整的 :ref:`不向后兼容的更改列表 ` 和 :ref:`不建议使用的功能列表 `。" msgid "" "While not a new feature, it's important to note that Django 1.2 introduces " "the first shift in our Python compatibility policy since Django's initial " "public debut. Previous Django releases were tested and supported on 2.x " "Python versions from 2.3 up; Django 1.2, however, drops official support for " "Python 2.3. As such, the minimum Python version required for Django is now " "2.4, and Django is tested and supported on Python 2.4, 2.5 and 2.6, and will " "be supported on the as-yet-unreleased Python 2.7." msgstr "" "虽然这不是一个新功能,但值得注意的是,自 Django 首次公开亮相以来,Django 1.2 " "首次改变了我们的 Python 兼容性政策。以前的 Django 版本已经过测试并支持从 2.3 " "开始的 2.x Python 版本;然而,Django 1.2 放弃了对 Python 2.3 的官方支持。因" "此,现在 Django 所需的最低 Python 版本为 2.4,Django 已经过测试并支持 Python " "2.4 、 2.5 和 2.6,并将支持尚未发布的 Python 2.7 。" msgid "" "This change should affect only a small number of Django users, as most " "operating-system vendors today are shipping Python 2.4 or newer as their " "default version. If you're still using Python 2.3, however, you'll need to " "stick to Django 1.1 until you can upgrade; per :doc:`our support policy `, Django 1.1 will continue to receive security " "support until the release of Django 1.3." msgstr "" "这个变化应该只会影响少数 Django 用户,因为大多数操作系统供应商现在都默认安装 " "Python 2.4 或更新的版本。然而,如果你仍然在使用 Python 2.3,那么你需要继续使" "用 Django 1.1,直到你可以升级为止;根据 :doc:`我们的支持政策 `,Django 1.1 将在 Django 1.3 发布之前继续获得安全支持。" msgid "" "A roadmap for Django's overall 2.x Python support, and eventual transition " "to Python 3.x, is currently being developed, and will be announced prior to " "the release of Django 1.3." msgstr "" "Django 针对整体 2.x Python 支持的发展路线图以及最终过渡到 Python 3.x 的计划目" "前正在制定中,并将在 Django 1.3 发布之前宣布。" msgid "What's new in Django 1.2" msgstr "Django 1.2 新特性" msgid "Support for multiple databases" msgstr "支持多数据库" msgid "" "Django 1.2 adds the ability to use :doc:`more than one database ` in your Django project. Queries can be issued at a specific " "database with the ``using()`` method on ``QuerySet`` objects. Individual " "objects can be saved to a specific database by providing a ``using`` " "argument when you call ``save()``." msgstr "" "Django 1.2 增加了在你的 Django 项目中使用 :doc:`多个数据库 ` 的能力。可以使用 ``QuerySet`` 对象上的 ``using()`` 方法在特定数据库上发" "出查询。在调用 ``save()`` 时,可以通过提供 ``using`` 参数将单个对象保存到特定" "的数据库。" msgid "Model validation" msgstr "模型验证" msgid "" "Model instances now have support for :ref:`validating their own data " "`, and both model and form fields now accept " "configurable lists of :doc:`validators ` specifying " "reusable, encapsulated validation behavior. Note, however, that validation " "must still be performed explicitly. Simply invoking a model instance's " "``save()`` method will not perform any validation of the instance's data." msgstr "" "模型实例现在支持 :ref:`验证自己的数据 `,而且模型字段和表" "单字段现在都接受可配置的 :doc:`验证器列表 `,指定了可重用的" "封装的验证行为。但是,请注意,验证仍然必须显式地执行。只是调用模型实例的 " "``save()`` 方法不会对实例的数据执行任何验证。" msgid "Improved CSRF protection" msgstr "改进的 CSRF 保护" msgid "" "Django now has much improved protection against :doc:`Cross-Site Request " "Forgery (CSRF) attacks`. This type of attack occurs when a " "malicious website contains a link, a form button or some JavaScript that is " "intended to perform some action on your website, using the credentials of a " "logged-in user who visits the malicious site in their browser. A related " "type of attack, \"login CSRF,\" where an attacking site tricks a user's " "browser into logging into a site with someone else's credentials, is also " "covered." msgstr "" "Django 现在在防范 :doc:`跨站请求伪造(CSRF)攻击 ` 方面有了更加完" "善的保护。这种类型的攻击发生在恶意网站包含一个链接、一个表单按钮或一些 " "JavaScript,旨在使用已登录用户的凭据在其浏览器中访问恶意网站的用户来执行某些" "操作。相关的一种攻击类型是“登录 CSRF”,其中攻击站点欺骗用户的浏览器,使其使用" "别人的凭据登录到某个站点,这也得到了覆盖。" msgid "Messages framework" msgstr "消息框架" msgid "" "Django now includes a robust and configurable :doc:`messages framework ` with built-in support for cookie- and session-based " "messaging, for both anonymous and authenticated clients. The messages " "framework replaces the deprecated user message API and allows you to " "temporarily store messages in one request and retrieve them for display in a " "subsequent request (usually the next one)." msgstr "" "Django 现在包括一个强大且可配置的 :doc:`消息框架 `,内" "置支持基于 cookie 和会话的消息传递,适用于匿名和已验证的客户端。消息框架替代" "了不建议使用的用户消息 API,并允许你在一个请求中临时存储消息,然后在后续请求" "中检索它们以显示(通常是下一个请求)。" msgid "Object-level permissions" msgstr "对象级权限" msgid "" "A foundation for specifying permissions at the per-object level has been " "added. Although there is no implementation of this in core, a custom " "authentication backend can provide this implementation and it will be used " "by :class:`django.contrib.auth.models.User`. See the :doc:`authentication " "docs ` for more information." msgstr "" "已添加了在每个对象级别指定权限的基础。尽管核心中没有此功能的实现,但自定义身" "份验证后端可以提供此实现,并将被 :class:`django.contrib.auth.models.User` 使" "用。有关更多信息,请参阅 :doc:`身份验证文档 `。" msgid "Permissions for anonymous users" msgstr "匿名用户的权限" msgid "" "If you provide a custom auth backend with ``supports_anonymous_user`` set to " "``True``, AnonymousUser will check the backend for permissions, just like " "User already did. This is useful for centralizing permission handling - " "apps can always delegate the question of whether something is allowed or not " "to the authorization/authentication backend. See the :doc:`authentication " "docs ` for more details." msgstr "" "如果你提供一个自定义的身份验证后端,并将 ``supports_anonymous_user`` 设置为 " "``True``,那么 AnonymousUser 将像 User 一样检查后端的权限。这对于集中处理权限" "非常有用 - 应用程序始终可以将是否允许某些操作的问题委托给授权/身份验证后端。" "有关更多详细信息,请参阅 :doc:`身份验证文档 `。" msgid "Relaxed requirements for usernames" msgstr "放宽用户名要求" msgid "" "The built-in :class:`~django.contrib.auth.models.User` model's :attr:" "`~django.contrib.auth.models.User.username` field now allows a wider range " "of characters, including ``@``, ``+``, ``.`` and ``-`` characters." msgstr "" "内置的 :class:`~django.contrib.auth.models.User` 模型的 :attr:`~django." "contrib.auth.models.User.username` 字段现在允许更广泛范围的字符,包括 ``@``、" "``+``、``.`` 和 ``-`` 字符。" msgid "Email backends" msgstr "邮件后端" msgid "" "You can now :ref:`configure the way that Django sends email `. Instead of using SMTP to send all email, you can now choose a " "configurable email backend to send messages. If your hosting provider uses a " "sandbox or some other non-SMTP technique for sending mail, you can now " "construct an email backend that will allow Django's standard :doc:`mail " "sending methods` to use those facilities." msgstr "" "现在你可以 :ref:`配置 Django 发送电子邮件的方式 `。不再" "使用 SMTP 来发送所有电子邮件,你现在可以选择一个可配置的电子邮件后端来发送消" "息。如果你的托管提供商使用沙盒或其他非-SMTP 发送邮件的技术,你现在可以构建一" "个电子邮件后端,使 Django 的标准 :doc:`邮件发送方法` 可以使用" "这些设施。" msgid "" "This also makes it easier to debug mail sending. Django ships with backend " "implementations that allow you to send email to a :ref:`file`, to the :ref:`console`, or to :" "ref:`memory`. You can even configure all email " "to be :ref:`thrown away`." msgstr "" "这也使得调试邮件发送更加容易。Django 提供了后端实现,允许你将电子邮件发送到 :" "ref:`文件`、:ref:`控制台`,或 :ref:`内存`。你甚至可以配置所有的电" "子邮件都被 :ref:`丢弃`。" msgid "\"Smart\" :ttag:`if` tag" msgstr "\"智能\" :ttag:`if` 标签" msgid "" "The :ttag:`if` tag has been upgraded to be much more powerful. First, we've " "added support for comparison operators. No longer will you have to type:" msgstr "" ":ttag:`if` 标签已升级为更加强大。首先,我们增加了对比较运算符的支持。你不再需" "要输入如下内容:" msgid "You can now do this:" msgstr "现在你可以这样做:" msgid "" "There's really no reason to use ``{% ifequal %}`` or ``{% ifnotequal %}`` " "anymore, unless you're the nostalgic type." msgstr "" "除非你是怀旧型的,否则没有理由再使用 ``{% ifequal %}`` 或 ``{% ifnotequal %}" "``。" msgid "" "The operators supported are ``==``, ``!=``, ``<``, ``>``, ``<=``, ``>=``, " "``in`` and ``not in``, all of which work like the Python operators, in " "addition to ``and``, ``or`` and ``not``, which were already supported." msgstr "" "支持的运算符包括 ``==``、``!=``、``<``、``>``、``<=``、``>=``、``in`` 和 " "``not in``,它们都像 Python 运算符一样工作,此外还支持 ``and``、``or`` 和 " "``not``,这些已经被支持了。" msgid "Also, filters may now be used in the ``if`` expression. For example:" msgstr "此外,现在可以在 ``if`` 表达式中使用过滤器。例如:" msgid "Template caching" msgstr "模板缓存" msgid "" "In previous versions of Django, every time you rendered a template, it would " "be reloaded from disk. In Django 1.2, you can use a :ref:`cached template " "loader ` to load templates once, then cache the result for " "every subsequent render. This can lead to a significant performance " "improvement if your templates are broken into lots of smaller subtemplates " "(using the ``{% extends %}`` or ``{% include %}`` tags)." msgstr "" "在之前的 Django 版本中,每次渲染模板时都会重新从磁盘加载。在 Django 1.2 中," "你可以使用 :ref:`缓存模板加载器 ` 来加载模板一次,然后为每" "个后续的渲染缓存结果。如果你的模板被拆分成许多较小的子模板(使用 ``{% " "extends %}`` 或 ``{% include %}`` 标签),这可以导致显著的性能提升。" msgid "" "As a side effect, it is now much easier to support non-Django template " "languages." msgstr "作为一个副作用,现在更容易支持非 Django 模板语言。" msgid "Class-based template loaders" msgstr "基于类的模板加载器" msgid "" "As part of the changes made to introduce `Template caching`_ and following " "a general trend in Django, the template loaders API has been modified to use " "template loading mechanisms that are encapsulated in Python classes as " "opposed to functions, the only method available until Django 1.1." msgstr "" "作为引入 `模板缓存`_ 所做的更改的一部分,并遵循 Django 中的一般趋势,模板加载" "器 API 已经被修改为使用封装在 Python 类中的模板加载机制,而不是像 Django 1.1 " "中只有函数可用。" msgid "" "All the template loaders :ref:`shipped with Django ` have " "been ported to the new API but they still implement the function-based API " "and the template core machinery still accepts function-based loaders " "(builtin or third party) so there is no immediate need to modify your " "``TEMPLATE_LOADERS`` setting in existing projects, things will keep working " "if you leave it untouched up to and including the Django 1.3 release." msgstr "" "所有 :ref:`随 Django 一起提供的模板加载器 ` 都已经转换到新" "的 API,但它们仍然实现了基于函数的 API,而模板核心机制仍然接受基于函数的加载" "器(内置或第三方的),因此在现有项目中不需要立即修改你的 " "``TEMPLATE_LOADERS`` 设置,如果你不更改它,事情将一直正常工作,直到 Django " "1.3 版本为止。" msgid "" "If you have developed your own custom template loaders we suggest to " "consider porting them to a class-based implementation because the code for " "backwards compatibility with function-based loaders starts its deprecation " "process in Django 1.2 and will be removed in Django 1.4. There is a " "description of the API these loader classes must implement in the template " "API reference and you can also examine the source code of the loaders " "shipped with Django." msgstr "" "如果你已经开发了自己的自定义模板加载器,我们建议考虑将它们移植到基于类的实" "现,因为在 Django 1.2 中,与基于函数的加载器向后兼容的代码开始被弃用,并将在 " "Django 1.4 中移除。在模板 API 参考中有关于这些加载器类必须实现的 API 的描述," "你还可以查看随 Django 附带的加载器的源代码。" msgid "Natural keys in fixtures" msgstr "固定装置中的自然键" msgid "" "Fixtures can now refer to remote objects using :ref:`topics-serialization-" "natural-keys`. This lookup scheme is an alternative to the normal primary-" "key based object references in a fixture, improving readability and " "resolving problems referring to objects whose primary key value may not be " "predictable or known." msgstr "" "现在,可以使用 :ref:`topics-serialization-natural-keys` 来引用远程对象的固定" "数据。这种查找方案是一种替代传统基于主键的对象引用的方式,可以提高可读性,并" "解决引用那些主键值可能不可预测或未知的对象的问题。" msgid "Fast failure for tests" msgstr "测试的快速失败" msgid "" "Both the :djadmin:`test` subcommand of ``django-admin.py`` and the " "``runtests.py`` script used to run Django's own test suite now support a ``--" "failfast`` option. When specified, this option causes the test runner to " "exit after encountering a failure instead of continuing with the test run. " "In addition, the handling of ``Ctrl-C`` during a test run has been improved " "to trigger a graceful exit from the test run that reports details of the " "tests that were run before the interruption." msgstr "" "``django-admin.py`` 的 :djadmin:`test` 子命令和用于运行 Django 自己的测试套件" "的 ``runtests.py`` 脚本现在都支持 ``--failfast`` 选项。当指定此选项时,测试运" "行器在遇到失败后会退出,而不是继续运行测试。此外,在测试运行期间改进了对 " "``Ctrl-C`` 的处理,触发了从测试运行中优雅退出,并报告中断前运行的测试的详细信" "息。" msgid "``BigIntegerField``" msgstr "``BigIntegerField``" msgid "" "Models can now use a 64-bit :class:`~django.db.models.BigIntegerField` type." msgstr "" "现在,模型可以使用 64 位的 :class:`~django.db.models.BigIntegerField` 类型。" msgid "Improved localization" msgstr "改善的本地化" msgid "" "Django's :doc:`internationalization framework ` has been " "expanded with locale-aware formatting and form processing. That means, if " "enabled, dates and numbers on templates will be displayed using the format " "specified for the current locale. Django will also use localized formats " "when parsing data in forms. See :doc:`/topics/i18n/formatting` for more " "details." msgstr "" "Django 的 :doc:`国际化框架 ` 已经扩展了,具备了区域感知的" "格式化和表单处理功能。这意味着,如果启用了国际化,模板中的日期和数字将使用当" "前区域设置指定的格式进行显示。Django 还会在解析表单中的数据时使用本地化格式。" "有关更多详细信息,请参阅 :doc:`/topics/i18n/formatting`。" msgid "``readonly_fields`` in ``ModelAdmin``" msgstr "``ModelAdmin`` 中的 ``readonly_fields``" msgid "" ":attr:`django.contrib.admin.ModelAdmin.readonly_fields` has been added to " "enable non-editable fields in add/change pages for models and inlines. Field " "and calculated values can be displayed alongside editable fields." msgstr "" ":attr:`django.contrib.admin.ModelAdmin.readonly_fields` 已经被添加,用于在模" "型和内联的添加/更改页面上启用不可编辑的字段。字段和计算值可以显示在可编辑字段" "旁边。" msgid "Customizable syntax highlighting" msgstr "可定制的语法高亮" msgid "" "You can now use a :envvar:`DJANGO_COLORS` environment variable to modify or " "disable the colors used by ``django-admin.py`` to provide :ref:`syntax " "highlighting `." msgstr "" "现在,你可以使用 :envvar:`DJANGO_COLORS` 环境变量来修改或禁用 ``django-admin." "py`` 用于提供 :ref:`语法高亮 ` 的颜色。" msgid "Syndication feeds as views" msgstr "将聚合订阅作为视图" msgid "" ":doc:`Syndication feeds ` can now be used directly " "as views in your :doc:`URLconf `. This means that you can " "maintain complete control over the URL structure of your feeds. Like any " "other view, feeds views are passed a ``request`` object, so you can do " "anything you would normally do with a view, like user based access control, " "or making a feed a named URL." msgstr "" ":doc:`Syndication feeds ` 现在可以直接用作你的 :" "doc:`URLconf ` 中的视图。这意味着你可以完全控制你的 feeds " "的 URL 结构。与任何其他视图一样,feeds 视图会传递一个 ``request`` 对象,因此" "你可以像处理常规视图一样进行操作,如基于用户的访问控制,或将 feed 作为具名 " "URL。" msgid "" "The most significant new feature for :doc:`GeoDjango ` in 1.2 is support for multiple spatial databases. As a result, the " "following :ref:`spatial database backends ` are now " "included:" msgstr "" "在 1.2 版本中,对于 :doc:`GeoDjango ` 最重要的新功能" "之一是对多个空间数据库的支持。因此,现在包括了以下 :ref:`空间数据库后端 " "`:" msgid "``django.contrib.gis.db.backends.postgis``" msgstr "``django.contrib.gis.db.backends.postgis``" msgid "``django.contrib.gis.db.backends.mysql``" msgstr "``django.contrib.gis.db.backends.mysql``" msgid "``django.contrib.gis.db.backends.oracle``" msgstr "``django.contrib.gis.db.backends.oracle``" msgid "``django.contrib.gis.db.backends.spatialite``" msgstr "``django.contrib.gis.db.backends.spatialite``" msgid "" "GeoDjango now supports the rich capabilities added in the PostGIS 1.5 " "release. New features include support for the :ref:`geography type " "` and enabling of :ref:`distance queries ` " "with non-point geometries on geographic coordinate systems." msgstr "" "GeoDjango 现在支持 PostGIS 1.5 发布中添加的丰富功能。新功能包括对 :ref:" "`geography 类型 ` 的支持,并在地理坐标系统上启用了对非点几何" "图形的 :ref:`距离查询 `。" msgid "" "Support for 3D geometry fields was added, and may be enabled by setting the :" "attr:`~django.contrib.gis.db.models.GeometryField.dim` keyword to 3 in your :" "class:`~django.contrib.gis.db.models.GeometryField`. The :class:`~django." "contrib.gis.db.models.Extent3D` aggregate and ``extent3d()`` ``GeoQuerySet`` " "method were added as a part of this feature." msgstr "" "已添加对 3D 几何字段的支持,可以通过在 :class:`~django.contrib.gis.db.models." "GeometryField` 中设置 :attr:`~django.contrib.gis.db.models.GeometryField." "dim` 关键字为 3 来启用。作为此功能的一部分,还添加了 :class:`~django.contrib." "gis.db.models.Extent3D` 聚合和 ``extent3d()`` ``GeoQuerySet`` 方法。" msgid "" "The ``force_rhr()``, ``reverse_geom()``, and ``geohash()`` ``GeoQuerySet`` " "methods are new." msgstr "" "新添加了 ``force_rhr()``、``reverse_geom()`` 和 ``geohash()`` " "``GeoQuerySet`` 方法。" msgid "" "The GEOS interface was updated to use thread-safe C library functions when " "available on the platform." msgstr "当平台支持时,更新了 GEOS 接口以使用线程安全的 C 库函数。" msgid "" "The GDAL interface now allows the user to set a :attr:`~django.contrib.gis." "gdal.Layer.spatial_filter` on the features returned when iterating over a :" "class:`~django.contrib.gis.gdal.Layer`." msgstr "" "GDAL 接口现在允许用户在迭代 :class:`~django.contrib.gis.gdal.Layer` 时设置 :" "attr:`~django.contrib.gis.gdal.Layer.spatial_filter`,以过滤返回的要素。" msgid "" "Finally, :doc:`GeoDjango's documentation ` is now " "included with Django's and is no longer hosted separately at ``geodjango." "org``." msgstr "" "最后,:doc:`GeoDjango 的文档 ` 现在已经与 Django 的文" "档一起包括在内,不再单独托管在 ``geodjango.org`` 上。" msgid "JavaScript-assisted handling of inline related objects in the admin" msgstr "在管理中使用 JavaScript 辅助处理内联相关对象。" msgid "" "If a user has JavaScript enabled in their browser, the interface for inline " "objects in the admin now allows inline objects to be dynamically added and " "removed. Users without JavaScript-enabled browsers will see no change in the " "behavior of inline objects." msgstr "" "如果用户的浏览器启用了 JavaScript,则管理中内联对象的界面现在允许动态添加和删" "除内联对象。没有启用 JavaScript 的浏览器的用户将不会看到内联对象行为的任何变" "化。" msgid "New ``now`` template tag format specifier characters: ``c`` and ``u``" msgstr "新的 ``now`` 模板标签格式说明符字符:``c`` 和 ``u``" msgid "" "The argument to the :ttag:`now` has gained two new format characters: ``c`` " "to specify that a datetime value should be formatted in ISO 8601 format, and " "``u`` that allows output of the microseconds part of a datetime or time " "value." msgstr "" ":ttag:`now` 的参数新增了两个新的格式字符:``c`` 用于指定将日期时间值格式化为 " "ISO 8601 格式,``u`` 允许输出日期时间或时间值的微秒部分。" msgid "" "These are also available in others parts like the :tfilter:`date` and :" "tfilter:`time` template filters, the ``humanize`` template tag library and " "the new `format localization`_ framework." msgstr "" "这些新格式字符也在其他地方可用,如 :tfilter:`date` 和 :tfilter:`time` 模板过" "滤器、``humanize`` 模板标签库以及新的 `格式本地化`_ 框架。" msgid "Backwards-incompatible changes in 1.2" msgstr "1.2 版本中的不向后兼容的更改。" msgid "" "Wherever possible the new features above have been introduced in a backwards-" "compatible manner per :doc:`our API stability policy ` " "policy. This means that practically all existing code which worked with " "Django 1.1 will continue to work with Django 1.2; such code will, however, " "begin issuing warnings (see below for details)." msgstr "" "在可能的情况下,上述新功能均以向后兼容的方式引入,遵循 :doc:`我们的 API 稳定" "性政策 `。这意味着几乎所有与 Django 1.1 兼容的现有代码都" "将继续适用于 Django 1.2 版本;然而,这样的代码将开始发出警告(详情见下文)。" msgid "" "However, a handful of features *have* changed in ways that, for some users, " "will be immediately backwards-incompatible. Those changes are detailed below." msgstr "" "然而,有一些功能确实以一种对某些用户来说立即不向后兼容的方式发生了变化。这些" "变化将在下面详细说明。" msgid "CSRF Protection" msgstr "CSRF 保护。" msgid "" "We've made large changes to the way CSRF protection works, detailed in :doc:" "`the CSRF documentation `. Here are the major changes you should " "be aware of:" msgstr "" "我们对 CSRF 保护的工作方式进行了重大改变,详细信息请参阅 :doc:`CSRF 文档 `。以下是你应该注意的主要变化:" msgid "" "``CsrfResponseMiddleware`` and ``CsrfMiddleware`` have been deprecated and " "will be removed completely in Django 1.4, in favor of a template tag that " "should be inserted into forms." msgstr "" "``CsrfResponseMiddleware`` 和 ``CsrfMiddleware`` 已被弃用,并将在 Django 1.4 " "中完全删除,取而代之的是应该插入到表单中的模板标签。" msgid "" "All contrib apps use a ``csrf_protect`` decorator to protect the view. This " "requires the use of the ``csrf_token`` template tag in the template. If you " "have used custom templates for contrib views, you MUST READ THE UPGRADE " "INSTRUCTIONS to fix those templates." msgstr "" "所有的 contrib 应用都使用了一个 ``csrf_protect`` 装饰器来保护视图。这需要在模" "板中使用 ``csrf_token`` 模板标签。如果你已经使用了自定义模板来定制 contrib 视" "图,你必须阅读升级说明来修复这些模板。" msgid "Documentation removed" msgstr "已删除文档" msgid "" "The upgrade notes have been removed in current Django docs. Please refer to " "the docs for Django 1.3 or older to find these instructions." msgstr "" "当前 Django 文档中已删除了升级说明。请参考 Django 1.3 或更早版本的文档以查找" "这些说明。" msgid "" "``CsrfViewMiddleware`` is included in ``MIDDLEWARE_CLASSES`` by default. " "This turns on CSRF protection by default, so views that accept POST requests " "need to be written to work with the middleware. Instructions on how to do " "this are found in the CSRF docs." msgstr "" "``CsrfViewMiddleware`` 默认包含在 ``MIDDLEWARE_CLASSES`` 中。这默认启用了 " "CSRF 保护,因此接受 POST 请求的视图需要编写以与中间件一起使用。如何做到这一点" "的说明可以在 CSRF 文档中找到。" msgid "" "All of the CSRF has moved from contrib to core (with backwards compatible " "imports in the old locations, which are deprecated and will cease to be " "supported in Django 1.4)." msgstr "" "所有的 CSRF 已经从 contrib 转移到了核心(在旧的位置有向后兼容的导入,这些导入" "已被弃用,并将在 Django 1.4 中停止支持)。" msgid "``get_db_prep_*()`` methods on ``Field``" msgstr "``Field`` 上的 ``get_db_prep_*()`` 方法" msgid "" "Prior to Django 1.2, a custom ``Field`` had the option of defining several " "functions to support conversion of Python values into database-compatible " "values. A custom field might look something like::" msgstr "" "在 Django 1.2 之前,自定义的 ``Field`` 可以定义多个函数,用于将 Python 值转换" "为与数据库兼容的值。一个自定义字段可能如下所示:" msgid "" "In 1.2, these three methods have undergone a change in prototype, and two " "extra methods have been introduced::" msgstr "在 1.2 版本中,这三种方法的原型发生了变化,还引入了两种额外的方法:" msgid "" "These changes are required to support multiple databases -- ``db_type`` and " "``get_db_prep_*`` can no longer make any assumptions regarding the database " "for which it is preparing. The ``connection`` argument now provides the " "preparation methods with the specific connection for which the value is " "being prepared." msgstr "" "这些更改是为了支持多个数据库 - ``db_type`` 和 ``get_db_prep_*`` 不能再对其准" "备的数据库做任何假设。现在,``connection`` 参数为准备方法提供了特定的连接,用" "于准备该值。" msgid "" "The two new methods exist to differentiate general data-preparation " "requirements from requirements that are database-specific. The ``prepared`` " "argument is used to indicate to the database-preparation methods whether " "generic value preparation has been performed. If an unprepared (i.e., " "``prepared=False``) value is provided to the ``get_db_prep_*()`` calls, they " "should invoke the corresponding ``get_prep_*()`` calls to perform generic " "data preparation." msgstr "" "这两个新方法的存在是为了区分通用的数据准备需求和特定于数据库的需求。" "``prepared`` 参数用于指示数据库准备方法是否已执行通用值准备。如果将未准备好的" "值(即 ``prepared=False``)提供给 ``get_db_prep_*()`` 调用,它们应该调用相应" "的 ``get_prep_*()`` 调用来执行通用数据准备。" msgid "" "We've provided conversion functions that will transparently convert " "functions adhering to the old prototype into functions compatible with the " "new prototype. However, these conversion functions will be removed in Django " "1.4, so you should upgrade your ``Field`` definitions to use the new " "prototype as soon as possible." msgstr "" "我们提供了转换函数,可以将符合旧原型的函数透明地转换为与新原型兼容的函数。但" "是,这些转换函数将在 Django 1.4 中移除,因此你应该尽快升级你的 ``Field`` 定" "义,以使用新的原型。" msgid "" "If your ``get_db_prep_*()`` methods made no use of the database connection, " "you should be able to upgrade by renaming ``get_db_prep_value()`` to " "``get_prep_value()`` and ``get_db_prep_lookup()`` to ``get_prep_lookup()``. " "If you require database specific conversions, then you will need to provide " "an implementation ``get_db_prep_*`` that uses the ``connection`` argument to " "resolve database-specific values." msgstr "" "如果你的 ``get_db_prep_*()`` 方法没有使用数据库连接,你应该可以通过将 " "``get_db_prep_value()`` 重命名为 ``get_prep_value()``,将 " "``get_db_prep_lookup()`` 重命名为 ``get_prep_lookup()`` 来进行升级。如果你需" "要数据库特定的转换,那么你需要提供一个实现 ``get_db_prep_*`` 的方法,使用 " "``connection`` 参数来解析数据库特定的值。" msgid "Stateful template tags" msgstr "有状态的模板标签" msgid "" "Template tags that store rendering state on their ``Node`` subclass have " "always been vulnerable to thread-safety and other issues; as of Django 1.2, " "however, they may also cause problems when used with the new :ref:`cached " "template loader`." msgstr "" "将渲染状态存储在其 ``Node`` 子类上的模板标签一直容易受到线程安全和其他问题的" "影响;然而,从Django 1.2开始,当与新的 :ref:`cached template loader` 一起使用时,它们可能也会引发问题。" msgid "" "All of the built-in Django template tags are safe to use with the cached " "loader, but if you're using custom template tags that come from third party " "packages, or from your own code, you should ensure that the ``Node`` " "implementation for each tag is thread-safe. For more information, see :ref:" "`template tag thread safety considerations`." msgstr "" "所有内置的 Django 模板标签都可以安全地与缓存加载器一起使用,但如果你使用的是" "来自第三方包或你自己的代码的自定义模板标签,你应该确保每个标签的 ``Node`` 实" "现是线程安全的。更多信息,请参阅 :ref:`模板标签线程安全注意事项" "`。" msgid "" "You may also need to update your templates if you were relying on the " "implementation of Django's template tags *not* being thread safe. The :ttag:" "`cycle` tag is the most likely to be affected in this way, especially when " "used in conjunction with the :ttag:`include` tag. Consider the following " "template fragment:" msgstr "" "如果你依赖于 Django 模板标签的实现 *不* 是线程安全的,你可能还需要更新你的模" "板。在这种情况下,:ttag:`cycle` 标签最有可能受到影响,特别是当与 :ttag:" "`include` 标签一起使用时。考虑以下模板片段:" msgid "with a ``subtemplate.html`` that reads:" msgstr "带有一个 ``subtemplate.html``,其内容如下:" msgid "Using the non-thread-safe, pre-Django 1.2 renderer, this would output:" msgstr "使用非线程安全的、 Django 1.2 之前的渲染器,输出如下:" msgid "Using the thread-safe Django 1.2 renderer, you will instead get:" msgstr "使用线程安全的 Django 1.2 渲染器,你将得到:" msgid "" "This is because each rendering of the :ttag:`include` tag is an independent " "rendering. When the :ttag:`cycle` tag was not thread safe, the state of the :" "ttag:`cycle` tag would leak between multiple renderings of the same :ttag:" "`include`. Now that the :ttag:`cycle` tag is thread safe, this leakage no " "longer occurs." msgstr "" "这是因为每次渲染 :ttag:`include` 标签都是独立的渲染。当 :ttag:`cycle` 标签不" "是线程安全时,:ttag:`cycle` 标签的状态会在同一个 :ttag:`include` 的多次渲染之" "间泄漏。现在 :ttag:`cycle` 标签是线程安全的,这种泄漏不再发生。" msgid "``user_passes_test``, ``login_required`` and ``permission_required``" msgstr "``user_passes_test``, ``login_required`` 和 ``permission_required``" msgid "" "``django.contrib.auth.decorators`` provides the decorators " "``login_required``, ``permission_required`` and ``user_passes_test``. " "Previously it was possible to use these decorators both on functions (where " "the first argument is 'request') and on methods (where the first argument is " "'self', and the second argument is 'request'). Unfortunately, flaws were " "discovered in the code supporting this: it only works in limited " "circumstances, and produces errors that are very difficult to debug when it " "does not work." msgstr "" "``django.contrib.auth.decorators`` 提供了装饰器 ``login_required``、" "``permission_required`` 和 ``user_passes_test``。以前可以在函数上使用这些装饰" "器(其中第一个参数是 'request'),也可以在方法上使用(其中第一个参数是 " "'self',第二个参数是 'request')。不幸的是,发现了支持这种用法的代码存在缺" "陷:它只在有限的情况下工作,并且在不起作用时会产生非常难以调试的错误。" msgid "" "For this reason, the 'auto adapt' behavior has been removed, and if you are " "using these decorators on methods, you will need to manually apply :func:" "`django.utils.decorators.method_decorator` to convert the decorator to one " "that works with methods. For example, you would change code from this::" msgstr "" "因此,已经移除了'auto adapt'行为,如果你在方法上使用这些装饰器,你需要手动应" "用 :func:`django.utils.decorators.method_decorator` 来将装饰器转换为适用于方" "法的装饰器。例如,你需要将代码从这样改为:" msgid "or::" msgstr "或者:" msgid "" "For those of you who've been following the development trunk, this change " "also applies to other decorators introduced since 1.1, including " "``csrf_protect``, ``cache_control`` and anything created using " "``decorator_from_middleware``." msgstr "" "对于那些一直关注开发主干的人,这个变更也适用于自 1.1 版以来引入的其他装饰器," "包括 ``csrf_protect``、``cache_control`` 和使用 " "``decorator_from_middleware`` 创建的任何装饰器。" msgid ":ttag:`if` tag changes" msgstr ":ttag:`if` 标签的变更" msgid "" "Due to new features in the :ttag:`if` template tag, it no longer accepts " "'and', 'or' and 'not' as valid **variable** names. Previously, these strings " "could be used as variable names. Now, the keyword status is always enforced, " "and template code such as ``{% if not %}`` or ``{% if and %}`` will throw a " "``TemplateSyntaxError``. Also, ``in`` is a new keyword and so is not a valid " "variable name in this tag." msgstr "" "由于 :ttag:`if` 模板标签中的新功能,它不再接受 'and'、'or' 和 'not' 作为有效" "的 **变量** 名称。以前,这些字符串可以用作变量名。现在,关键字状态始终受到强" "制执行,因此模板代码如 ``{% if not %}`` 或 ``{% if and %}`` 将引发 " "``TemplateSyntaxError``。此外,``in`` 是一个新关键字,因此在此标签中不是有效" "的变量名。" msgid "``LazyObject``" msgstr "``LazyObject``" msgid "" "``LazyObject`` is an undocumented-but-often-used utility class used for " "lazily wrapping other objects of unknown type." msgstr "" "``LazyObject`` 是一个未记录但经常使用的实用类,用于懒惰地包装其他未知类型的对" "象。" msgid "" "In Django 1.1 and earlier, it handled introspection in a non-standard way, " "depending on wrapped objects implementing a public method named " "``get_all_members()``. Since this could easily lead to name clashes, it has " "been changed to use the standard Python introspection method, involving " "``__members__`` and ``__dir__()``." msgstr "" "在 Django 1.1 及更早版本中,它以一种非标准的方式处理内省,依赖于被包装的对象" "实现一个名为 ``get_all_members()`` 的公共方法。由于这可能会导致名称冲突,因此" "已更改为使用标准的 Python 内省方法,涉及 ``__members__`` 和 ``__dir__()``。" msgid "" "If you used ``LazyObject`` in your own code and implemented the " "``get_all_members()`` method for wrapped objects, you'll need to make a " "couple of changes:" msgstr "" "如果你在自己的代码中使用了 ``LazyObject`` 并为被包装的对象实现了 " "``get_all_members()`` 方法,你需要进行一些更改:" msgid "" "First, if your class does not have special requirements for introspection (i." "e., you have not implemented ``__getattr__()`` or other methods that allow " "for attributes not discoverable by normal mechanisms), you can simply remove " "the ``get_all_members()`` method. The default implementation on " "``LazyObject`` will do the right thing." msgstr "" "首先,如果你的类对内省没有特殊要求(即,你没有实现 ``__getattr__()`` 或其他允" "许通过正常机制无法发现的属性的方法),你可以简单地删除 ``get_all_members()`` " "方法。``LazyObject`` 上的默认实现会处理得当。" msgid "" "If you have more complex requirements for introspection, first rename the " "``get_all_members()`` method to ``__dir__()``. This is the standard " "introspection method for Python 2.6 and above. If you require support for " "Python versions earlier than 2.6, add the following code to the class::" msgstr "" "如果你对内省有更复杂的要求,首先将 ``get_all_members()`` 方法重命名为 " "``__dir__()``。这是 Python 2.6 及更高版本的标准内省方法。如果你需要支持早于 " "2.6 版本的 Python,请将以下代码添加到类中:" msgid "``__dict__`` on model instances" msgstr "模型实例上的 ``__dict__``" msgid "" "Historically, the ``__dict__`` attribute of a model instance has only " "contained attributes corresponding to the fields on a model." msgstr "在历史上,模型实例的 ``__dict__`` 属性仅包含与模型上的字段对应的属性。" msgid "" "In order to support multiple database configurations, Django 1.2 has added a " "``_state`` attribute to object instances. This attribute will appear in " "``__dict__`` for a model instance. If your code relies on iterating over " "``__dict__`` to obtain a list of fields, you must now be prepared to handle " "or filter out the ``_state`` attribute." msgstr "" "为了支持多个数据库配置,Django 1.2 添加了一个 ``_state`` 属性到对象实例中。这" "个属性将出现在模型实例的 ``__dict__`` 中。如果你的代码依赖于遍历 " "``__dict__`` 来获取字段列表,现在必须准备好处理或过滤掉 ``_state`` 属性。" msgid "" "The exit status code of the test runners (``tests/runtests.py`` and ``python " "manage.py test``) no longer represents the number of failed tests, because a " "failure of 256 or more tests resulted in a wrong exit status code. The exit " "status code for the test runner is now 0 for success (no failing tests) and " "1 for any number of test failures. If needed, the number of test failures " "can be found at the end of the test runner's output." msgstr "" "测试运行器(``tests/runtests.py`` 和 ``python manage.py test``)的退出状态码" "不再代表失败测试的数量,因为失败 256 个或更多测试会导致错误的退出状态码。现在" "测试运行器的退出状态码为 0 表示成功(没有失败测试),为 1 表示任何数量的测试" "失败。如果需要,可以在测试运行器的输出末尾找到测试失败的数量。" msgid "" "To fix bugs with cookies in Internet Explorer, Safari, and possibly other " "browsers, our encoding of cookie values was changed so that the comma and " "semicolon are treated as non-safe characters, and are therefore encoded as " "``\\054`` and ``\\073`` respectively. This could produce backwards " "incompatibilities, especially if you are storing comma or semi-colon in " "cookies and have JavaScript code that parses and manipulates cookie values " "client-side." msgstr "" "为了修复 Internet Explorer、Safari 和可能其他浏览器中的 cookie 问题,我们更改" "了对 cookie 值的编码,以使逗号和分号被视为非安全字符,因此它们被编码为 " "``\\054`` 和 ``\\073``。这可能会导致向后不兼容性,特别是如果你在 cookie 中存" "储逗号或分号,并且有客户端 JavaScript 代码解析和操作 cookie 值。" msgid "``ModelForm.is_valid()`` and ``ModelForm.errors``" msgstr "``ModelForm.is_valid()`` 和 ``ModelForm.errors``" msgid "" "Much of the validation work for ModelForms has been moved down to the model " "level. As a result, the first time you call ``ModelForm.is_valid()``, access " "``ModelForm.errors`` or otherwise trigger form validation, your model will " "be cleaned in-place. This conversion used to happen when the model was " "saved. If you need an unmodified instance of your model, you should pass a " "copy to the ``ModelForm`` constructor." msgstr "" "ModelForms 的大部分验证工作已经移到了模型级别。因此,第一次调用 ``ModelForm." "is_valid()``,访问 ``ModelForm.errors`` 或以其他方式触发表单验证时,你的模型" "将被原地清理。这个转换以前是在模型保存时发生的。如果你需要一个未修改的模型实" "例,你应该将一个副本传递给 ``ModelForm`` 构造函数。" msgid "``BooleanField`` on MySQL" msgstr "在 MySQL 上的 ``BooleanField``" msgid "" "In previous versions of Django, a model's ``BooleanField`` under MySQL would " "return its value as either ``1`` or ``0``, instead of ``True`` or ``False``; " "for most people this wasn't a problem because ``bool`` is a subclass of " "``int`` in Python. In Django 1.2, however, ``BooleanField`` on MySQL " "correctly returns a real ``bool``. The only time this should ever be an " "issue is if you were expecting the ``repr`` of a ``BooleanField`` to print " "``1`` or ``0``." msgstr "" "在之前的 Django 版本中,在 MySQL 下,模型的 ``BooleanField`` 会将其值返回为 " "``1`` 或 ``0``,而不是 ``True`` 或 ``False``;对于大多数人来说,这不是问题," "因为在 Python 中,``bool`` 是 ``int`` 的子类。然而,在 Django 1.2 中,MySQL " "上的 ``BooleanField`` 正确地返回一个真正的 ``bool``。唯一可能会引发问题的情况" "是,如果你期望一个 ``BooleanField`` 的 ``repr`` 打印出 ``1`` 或 ``0``。" msgid "Changes to the interpretation of ``max_num`` in FormSets" msgstr "对于 FormSets 中 ``max_num`` 的解释变更" msgid "" "As part of enhancements made to the handling of FormSets, the default value " "and interpretation of the ``max_num`` parameter to the :ref:`django.forms." "formsets.formset_factory() ` and :ref:`django.forms.models." "modelformset_factory() ` functions has changed " "slightly. This change also affects the way the :attr:`~django.contrib.admin." "InlineModelAdmin.max_num` argument is used for inline admin objects." msgstr "" "作为对 FormSets 处理的增强的一部分,``max_num`` 参数在 :ref:`django.forms." "formsets.formset_factory() ` 和 :ref:`django.forms.models." "modelformset_factory() ` 函数中的默认值和解释略有变" "化。这个变更也影响了内联管理对象的 :attr:`~django.contrib.admin." "InlineModelAdmin.max_num` 参数的使用方式。" msgid "" "Previously, the default value for ``max_num`` was ``0`` (zero). FormSets " "then used the boolean value of ``max_num`` to determine if a limit was to be " "imposed on the number of generated forms. The default value of ``0`` meant " "that there was no default limit on the number of forms in a FormSet." msgstr "" "以前,``max_num`` 的默认值是 ``0`` (零)。FormSets 然后使用 ``max_num`` 的布" "尔值来确定是否要对生成的表单数量设置限制。默认值 ``0`` 意味着在 FormSet 中没" "有默认限制的表单数量。" msgid "" "Starting with 1.2, the default value for ``max_num`` has been changed to " "``None``, and FormSets will differentiate between a value of ``None`` and a " "value of ``0``. A value of ``None`` indicates that no limit on the number of " "forms is to be imposed; a value of ``0`` indicates that a maximum of 0 forms " "should be imposed. This doesn't necessarily mean that no forms will be " "displayed -- see the :ref:`ModelFormSet documentation ` for more details." msgstr "" "从 1.2 版本开始,``max_num`` 的默认值已更改为 ``None``,并且 FormSets 将区分 " "``None`` 和 ``0`` 之间的值。``None`` 表示不限制表单数量;``0`` 表示最多允许 " "0 个表单。这并不一定意味着不会显示任何表单 - 请参阅 :ref:`ModelFormSet 文档 " "` 获取更多详细信息。" msgid "" "If you were manually specifying a value of ``0`` for ``max_num``, you will " "need to update your FormSet and/or admin definitions." msgstr "" "如果你手动指定了 ``0`` 作为 ``max_num`` 的值,你需要更新你的 FormSet 和/或管" "理定义。" msgid ":ref:`1.2-js-assisted-inlines`" msgstr ":ref:`1.2-js-assisted-inlines`" msgid "``email_re``" msgstr "``email_re``" msgid "" "An undocumented regular expression for validating email addresses has been " "moved from ``django.form.fields`` to ``django.core.validators``. You will " "need to update your imports if you are using it." msgstr "" "一个未记录的用于验证电子邮件地址的正则表达式已从 ``django.form.fields`` 移动" "到了 ``django.core.validators``。如果你在使用它,你需要更新你的导入。" msgid "Features deprecated in 1.2" msgstr "在 1.2 中被废弃的功能" msgid "" "Finally, Django 1.2 deprecates some features from earlier releases. These " "features are still supported, but will be gradually phased out over the next " "few release cycles." msgstr "" "最后,Django 1.2 弃用了一些早期版本的功能。这些功能仍然受支持,但将在接下来的" "几个版本周期内逐步淘汰。" msgid "" "Code taking advantage of any of the features below will raise a " "``PendingDeprecationWarning`` in Django 1.2. This warning will be silent by " "default, but may be turned on using Python's :mod:`warnings` module, or by " "running Python with a ``-Wd`` or ``-Wall`` flag." msgstr "" "使用以下任何功能的代码将在 Django 1.2 中引发 ``PendingDeprecationWarning``。" "这个警告默认情况下会被忽略,但可以使用 Python 的 :mod:`warnings` 模块来打开" "它,或者通过使用 ``-Wd`` 或 ``-Wall`` 标志来运行 Python 来启用它。" msgid "" "In Django 1.3, these warnings will become a ``DeprecationWarning``, which is " "*not* silent. In Django 1.4 support for these features will be removed " "entirely." msgstr "" "在 Django 1.3 中,这些警告将变为 ``DeprecationWarning``,它不会被忽略。在 " "Django 1.4 中,对这些功能的支持将完全移除。" msgid "" "For more details, see the documentation :doc:`Django's release process ` and our :doc:`deprecation timeline `.`" msgstr "" "有关更多详细信息,请参阅文档中的 :doc:`Django 发布过程 ` 和 :doc:`弃用时间表 `。" msgid "Specifying databases" msgstr "指定数据库" msgid "" "Prior to Django 1.2, Django used a number of settings to control access to a " "single database. Django 1.2 introduces support for multiple databases, and " "as a result the way you define database settings has changed." msgstr "" "在 Django 1.2 之前,Django 使用了许多设置来控制访问单个数据库。 Django 1.2 引" "入了对多数据库的支持,因此定义数据库设置的方式发生了变化。" msgid "" "Any existing Django settings file will continue to work as expected until " "Django 1.4. Until then, old-style database settings will be automatically " "translated to the new-style format." msgstr "" "任何现有的 Django 设置文件将继续按预期工作,直到 Django 1.4 。在此之前,旧式" "数据库设置将自动转换为新式格式。" msgid "" "In the old-style (pre 1.2) format, you had a number of ``DATABASE_`` " "settings in your settings file. For example::" msgstr "" "在旧式(1.2 版之前)的格式中,你的设置文件中有许多 ``DATABASE_`` 设置。例如:" msgid "" "These settings are now in a dictionary named :setting:`DATABASES`. Each item " "in the dictionary corresponds to a single database connection, with the name " "``'default'`` describing the default database connection. The setting names " "have also been shortened. The previous sample settings would now look like " "this::" msgstr "" "这些设置现在在名为 :setting:`DATABASES` 的字典中。字典中的每个条目对应一个单" "独的数据库连接,名称为 ``'default'`` 描述了默认的数据库连接。设置的名称也已经" "缩短。之前的示例设置现在会像这样:" msgid "This affects the following settings:" msgstr "这影响了以下设置:" msgid "Old setting" msgstr "旧设置" msgid "New Setting" msgstr "新设置" msgid "``DATABASE_ENGINE``" msgstr "``DATABASE_ENGINE``" msgid ":setting:`ENGINE `" msgstr ":setting:`ENGINE `" msgid "``DATABASE_HOST``" msgstr "``DATABASE_HOST``" msgid ":setting:`HOST`" msgstr ":setting:`HOST`" msgid "``DATABASE_NAME``" msgstr "``DATABASE_NAME``" msgid ":setting:`NAME`" msgstr ":setting:`NAME`" msgid "``DATABASE_OPTIONS``" msgstr "``DATABASE_OPTIONS``" msgid ":setting:`OPTIONS`" msgstr ":setting:`OPTIONS`" msgid "``DATABASE_PASSWORD``" msgstr "``DATABASE_PASSWORD``" msgid ":setting:`PASSWORD`" msgstr ":setting:`PASSWORD`" msgid "``DATABASE_PORT``" msgstr "``DATABASE_PORT``" msgid ":setting:`PORT`" msgstr ":setting:`PORT`" msgid "``DATABASE_USER``" msgstr "``DATABASE_USER``" msgid ":setting:`USER`" msgstr ":setting:`USER`" msgid "``TEST_DATABASE_CHARSET``" msgstr "``TEST_DATABASE_CHARSET``" msgid ":setting:`TEST_CHARSET`" msgstr ":setting:`TEST_CHARSET`" msgid "``TEST_DATABASE_COLLATION``" msgstr "``TEST_DATABASE_COLLATION``" msgid ":setting:`TEST_COLLATION`" msgstr ":setting:`TEST_COLLATION`" msgid "``TEST_DATABASE_NAME``" msgstr "``TEST_DATABASE_NAME``" msgid ":setting:`TEST_NAME`" msgstr ":setting:`TEST_NAME`" msgid "" "These changes are also required if you have manually created a database " "connection using ``DatabaseWrapper()`` from your database backend of choice." msgstr "" "如果你使用所选择的数据库后端手动创建了数据库连接,这些更改也是必需的,可以使" "用 ``DatabaseWrapper()``。" msgid "" "In addition to the change in structure, Django 1.2 removes the special " "handling for the built-in database backends. All database backends must now " "be specified by a fully qualified module name (i.e., ``django.db.backends." "postgresql_psycopg2``, rather than just ``postgresql_psycopg2``)." msgstr "" "除了结构的变更,Django 1.2 还移除了内置数据库后端的特殊处理。现在,所有的数据" "库后端都必须使用完全限定的模块名来指定(例如,``django.db.backends." "postgresql_psycopg2``,而不仅仅是 ``postgresql_psycopg2``)。" msgid "``postgresql`` database backend" msgstr "``postgresql`` 数据库后端" msgid "" "The ``psycopg1`` library has not been updated since October 2005. As a " "result, the ``postgresql`` database backend, which uses this library, has " "been deprecated." msgstr "" "``psycopg1`` 库自 2005 年 10 月以来没有更新。因此,使用这个库的 " "``postgresql`` 数据库后端已经被弃用。" msgid "" "If you are currently using the ``postgresql`` backend, you should migrate to " "using the ``postgresql_psycopg2`` backend. To update your code, install the " "``psycopg2`` library and change the :setting:`ENGINE ` " "setting to use ``django.db.backends.postgresql_psycopg2``." msgstr "" "如果你目前正在使用 ``postgresql`` 后端,你应该迁移到使用 " "``postgresql_psycopg2`` 后端。要更新你的代码,安装 ``psycopg2`` 库,并将 :" "setting:`ENGINE ` 设置更改为使用 ``django.db.backends." "postgresql_psycopg2``。" msgid "CSRF response-rewriting middleware" msgstr "CSRF 响应重写中间件" msgid "" "``CsrfResponseMiddleware``, the middleware that automatically inserted CSRF " "tokens into ``POST`` forms in outgoing pages, has been deprecated in favor " "of a template tag method (see above), and will be removed completely in " "Django 1.4. ``CsrfMiddleware``, which includes the functionality of " "``CsrfResponseMiddleware`` and ``CsrfViewMiddleware``, has likewise been " "deprecated." msgstr "" "``CsrfResponseMiddleware``,自动在传出页面的 ``POST`` 表单中插入 CSRF 令牌的" "中间件,已被弃用,推荐使用模板标签方法(见上文),并将在 Django 1.4 中完全移" "除。同样,包含了 ``CsrfResponseMiddleware`` 和 ``CsrfViewMiddleware`` 功能的 " "``CsrfMiddleware`` 也已被弃用。" msgid "" "Also, the CSRF module has moved from contrib to core, and the old imports " "are deprecated, as described in the upgrading notes." msgstr "" "此外,CSRF 模块已从 contrib 转移到核心,旧的导入已被弃用,如升级说明中所述。" msgid "``SMTPConnection``" msgstr "``SMTPConnection``" msgid "" "The ``SMTPConnection`` class has been deprecated in favor of a generic email " "backend API. Old code that explicitly instantiated an instance of an " "SMTPConnection::" msgstr "" "``SMTPConnection`` 类已被弃用,以支持通用的电子邮件后端 API。旧代码中明确实例" "化 ``SMTPConnection`` 实例的方式已被弃用:" msgid "" "...should now call :meth:`~django.core.mail.get_connection()` to instantiate " "a generic email connection::" msgstr "" "...现在应该调用 :meth:`~django.core.mail.get_connection()` 来实例化一个通用的" "电子邮件连接:" msgid "" "Depending on the value of the :setting:`EMAIL_BACKEND` setting, this may not " "return an SMTP connection. If you explicitly require an SMTP connection with " "which to send email, you can explicitly request an SMTP connection::" msgstr "" "根据 :setting:`EMAIL_BACKEND` 设置的值,这可能不会返回一个 SMTP 连接。如果你" "明确需要一个用于发送电子邮件的 SMTP 连接,可以显式请求一个 SMTP 连接:" msgid "" "If your call to construct an instance of ``SMTPConnection`` required " "additional arguments, those arguments can be passed to the :meth:`~django." "core.mail.get_connection()` call::" msgstr "" "如果你构造 ``SMTPConnection`` 实例的调用需要额外的参数,这些参数可以传递给 :" "meth:`~django.core.mail.get_connection()` 调用:" msgid "User Messages API" msgstr "用户消息 API" msgid "" "The API for storing messages in the user ``Message`` model (via ``user." "message_set.create``) is now deprecated and will be removed in Django 1.4 " "according to the standard :doc:`release process `." msgstr "" "通过 ``user.message_set.create`` 在用户 ``Message`` 模型中存储消息的 API 已被" "弃用,并将根据标准的 :doc:`发布流程 ` 在 Django " "1.4 中移除。" msgid "To upgrade your code, you need to replace any instances of this::" msgstr "要升级你的代码,你需要替换所有这样的实例:" msgid "...with the following::" msgstr "... 替换为以下内容:" msgid "" "Additionally, if you make use of the method, you need to replace the " "following::" msgstr "此外,如果你使用这个方法,你需要替换以下内容:" msgid "...with::" msgstr "... 替换为:" msgid "" "For more information, see the full :doc:`messages documentation `. You should begin to update your code to use the new API " "immediately." msgstr "" "有关更多信息,请参阅完整的 :doc:`消息文档 `。你应该立" "即开始更新你的代码以使用新的 API。" msgid "Date format helper functions" msgstr "日期格式辅助函数" msgid "" "``django.utils.translation.get_date_formats()`` and ``django.utils." "translation.get_partial_date_formats()`` have been deprecated in favor of " "the appropriate calls to ``django.utils.formats.get_format()``, which is " "locale-aware when ``USE_L10N`` is set to ``True``, and falls back to default " "settings if set to ``False``." msgstr "" "``django.utils.translation.get_date_formats()`` 和 ``django.utils." "translation.get_partial_date_formats()`` 已被弃用,推荐使用适当的调用 " "``django.utils.formats.get_format()``,当 ``USE_L10N`` 设置为 ``True`` 时,它" "是区域感知的,并在设置为 ``False`` 时回退到默认设置。" msgid "To get the different date formats, instead of writing this::" msgstr "要获得不同的日期格式,而不是编写这样的代码:" msgid "...use::" msgstr "... 使用:" msgid "Or, when directly formatting a date value::" msgstr "或者,在直接格式化日期值时:" msgid "The same applies to the globals found in ``django.forms.fields``:" msgstr "同样适用于 ``django.forms.fields`` 中找到的全局变量:" msgid "``DEFAULT_DATE_INPUT_FORMATS``" msgstr "``DEFAULT_DATE_INPUT_FORMATS``" msgid "``DEFAULT_TIME_INPUT_FORMATS``" msgstr "``DEFAULT_TIME_INPUT_FORMATS``" msgid "``DEFAULT_DATETIME_INPUT_FORMATS``" msgstr "``DEFAULT_DATETIME_INPUT_FORMATS``" msgid "" "Use ``django.utils.formats.get_format()`` to get the appropriate formats." msgstr "使用 ``django.utils.formats.get_format()`` 获取适当的格式。" msgid "Function-based test runners" msgstr "基于函数的测试运行器" msgid "" "Django 1.2 changes the test runner tools to use a class-based approach. Old " "style function-based test runners will still work, but should be updated to " "use the new :ref:`class-based runners `." msgstr "" "Django 1.2 更改了测试运行工具以使用基于类的方法。旧式的基于函数的测试运行工具" "仍然可以工作,但应该更新为使用新的 :ref:`基于类的运行工具 `。" msgid "``Feed`` in ``django.contrib.syndication.feeds``" msgstr "``django.contrib.syndication.feeds`` 中的 ``Feed``" msgid "" "The ``django.contrib.syndication.feeds.Feed`` class has been replaced by " "the :class:`django.contrib.syndication.views.Feed` class. The old ``feeds." "Feed`` class is deprecated, and will be removed in Django 1.4." msgstr "" "``django.contrib.syndication.feeds.Feed`` 类已被 :class:`django.contrib." "syndication.views.Feed` 类替代。旧的 ``feeds.Feed`` 类已被弃用,并将在 " "Django 1.4 中移除。" msgid "" "The new class has an almost identical API, but allows instances to be used " "as views. For example, consider the use of the old framework in the " "following :doc:`URLconf `::" msgstr "" "新的类具有几乎相同的 API,但允许将实例用作视图。例如,考虑以下 :doc:`URLconf " "` 中使用旧框架的示例:" msgid "" "Using the new Feed class, these feeds can be deployed directly as views::" msgstr "使用新的 Feed 类,这些 feed 可以直接作为视图部署:" msgid "" "If you currently use the ``feed()`` view, the ``LatestEntries`` class would " "often not need to be modified apart from subclassing the new :class:`~django." "contrib.syndication.views.Feed` class. The exception is if Django was " "automatically working out the name of the template to use to render the " "feed's description and title elements (if you were not specifying the " "``title_template`` and ``description_template`` attributes). You should " "ensure that you always specify ``title_template`` and " "``description_template`` attributes, or provide ``item_title()`` and " "``item_description()`` methods." msgstr "" "如果你当前使用 ``feed()`` 视图,那么 ``LatestEntries`` 类通常不需要进行修改," "除非它是新的 :class:`~django.contrib.syndication.views.Feed` 类的子类。唯一的" "例外是如果 Django 自动计算要用于渲染 feed 的描述和标题元素的模板名称(如果你" "没有指定 ``title_template`` 和 ``description_template`` 属性)。你应该确保始" "终指定 ``title_template`` 和 ``description_template`` 属性,或提供 " "``item_title()`` 和 ``item_description()`` 方法。" msgid "" "However, ``LatestEntriesByCategory`` uses the ``get_object()`` method with " "the ``bits`` argument to specify a specific category to show. In the new :" "class:`~django.contrib.syndication.views.Feed` class, ``get_object()`` " "method takes a ``request`` and arguments from the URL, so it would look like " "this::" msgstr "" "然而,``LatestEntriesByCategory`` 使用了 ``get_object()`` 方法,并通过 " "``bits`` 参数指定要显示的特定类别。在新的 :class:`~django.contrib." "syndication.views.Feed` 类中,``get_object()`` 方法接受一个 ``request`` 和来" "自 URL 的参数,所以它会像这样:" msgid "" "Additionally, the ``get_feed()`` method on ``Feed`` classes now take " "different arguments, which may impact you if you use the ``Feed`` classes " "directly. Instead of just taking an optional ``url`` argument, it now takes " "two arguments: the object returned by its own ``get_object()`` method, and " "the current ``request`` object." msgstr "" "另外,``Feed`` 类上的 ``get_feed()`` 方法现在接受不同的参数,如果你直接使用 " "``Feed`` 类,这可能会影响你。现在它不仅接受可选的 ``url`` 参数,还接受两个参" "数:它自己的 ``get_object()`` 方法返回的对象以及当前的 ``request`` 对象。" msgid "" "To take into account ``Feed`` classes not being initialized for each " "request, the ``__init__()`` method now takes no arguments by default. " "Previously it would have taken the ``slug`` from the URL and the ``request`` " "object." msgstr "" "为了考虑到 ``Feed`` 类不会为每个请求初始化,现在默认情况下 ``__init__()`` 方" "法不接受任何参数。以前它会接受来自 URL 的 ``slug`` 和 ``request`` 对象作为参" "数。" msgid "" "In accordance with `RSS best practices`_, RSS feeds will now include an " "``atom:link`` element. You may need to update your tests to take this into " "account." msgstr "" "根据 `RSS 最佳实践`_,RSS 订阅现在将包含一个 ``atom:link`` 元素。你可能需要更" "新你的测试以考虑这一点。" msgid "" "For more information, see the full :doc:`syndication framework documentation " "`." msgstr "" "有关更多信息,请参阅完整的 :doc:`syndication 框架文档 `。" msgid "Technical message IDs" msgstr "技术性消息 ID" msgid "" "Up to version 1.1 Django used technical message IDs to provide localizers " "the possibility to translate date and time formats. They were translatable :" "term:`translation strings ` that could be recognized " "because they were all upper case (for example :setting:`DATETIME_FORMAT`, :" "setting:`DATE_FORMAT`, :setting:`TIME_FORMAT`). They have been deprecated in " "favor of the new :doc:`/topics/i18n/formatting` infrastructure that allows " "localizers to specify that information in a ``formats.py`` file in the " "corresponding ``django/conf/locale//`` directory." msgstr "" "在版本 1.1 之前,Django 使用技术性的消息 ID 来提供本地化者翻译日期和时间格式" "的可能性。它们是可翻译的 :term:`翻译字符串 `,可以通过它" "们都是大写字母来识别(例如 :setting:`DATETIME_FORMAT`, :setting:" "`DATE_FORMAT`, :setting:`TIME_FORMAT`)。它们已被弃用,推荐使用新的 :doc:`/" "topics/i18n/formatting` 基础设施,允许本地化者在相应的 ``django/conf/locale/" "/`` 目录中的 ``formats.py`` 文件中指定这些信息。" msgid "" "To allow support for multiple databases, the GeoDjango database internals " "were changed substantially. The largest backwards-incompatible change is " "that the module ``django.contrib.gis.db.backend`` was renamed to :mod:" "`django.contrib.gis.db.backends`, where the full-fledged :ref:`spatial " "database backends ` now exist. The following sections " "provide information on the most-popular APIs that were affected by these " "changes." msgstr "" "为了支持多个数据库,GeoDjango 数据库内部进行了重大的更改。最大的向后不兼容性" "更改是模块 ``django.contrib.gis.db.backend`` 被重命名为 :mod:`django.contrib." "gis.db.backends`,其中现在存在全功能的 :ref:`空间数据库后端 `。以下各节提供了关于受这些更改影响最大的 API 的信息。" msgid "``SpatialBackend``" msgstr "``SpatialBackend``" msgid "" "Prior to the creation of the separate spatial backends, the ``django.contrib." "gis.db.backend.SpatialBackend`` object was provided as an abstraction to " "introspect on the capabilities of the spatial database. All of the " "attributes and routines provided by ``SpatialBackend`` are now a part of the " "``ops`` attribute of the database backend." msgstr "" "在创建单独的空间后端之前,提供了 ``django.contrib.gis.db.backend." "SpatialBackend`` 对象,用于内省空间数据库的功能。``SpatialBackend`` 提供的所" "有属性和例程现在都是数据库后端的 ``ops`` 属性的一部分。" msgid "" "The old module ``django.contrib.gis.db.backend`` is still provided for " "backwards-compatibility access to a ``SpatialBackend`` object, which is just " "an alias to the ``ops`` module of the *default* spatial database connection." msgstr "" "旧模块 ``django.contrib.gis.db.backend`` 仍然提供了向后兼容的访问 " "``SpatialBackend`` 对象的方式,它只是默认空间数据库连接的 ``ops`` 模块的别" "名。" msgid "" "Users that were relying on undocumented modules and objects within ``django." "contrib.gis.db.backend``, rather the abstractions provided by " "``SpatialBackend``, are required to modify their code. For example, the " "following import which would work in 1.1 and below::" msgstr "" "依赖于 ``django.contrib.gis.db.backend`` 中的未记录模块和对象,而不是 " "``SpatialBackend`` 提供的抽象的用户需要修改他们的代码。例如,在 1.1 及以下版" "本中可以正常工作的以下导入:" msgid "Would need to be changed::" msgstr "需要进行更改:" msgid "``SpatialRefSys`` and ``GeometryColumns`` models" msgstr "``SpatialRefSys`` 和 ``GeometryColumns`` 模型" msgid "" "In previous versions of GeoDjango, :mod:`django.contrib.gis.db.models` had " "``SpatialRefSys`` and ``GeometryColumns`` models for querying the OGC " "spatial metadata tables ``spatial_ref_sys`` and ``geometry_columns``, " "respectively." msgstr "" "在 GeoDjango 的早期版本中,:mod:`django.contrib.gis.db.models` 包含了用于查" "询 OGC 空间元数据表 ``spatial_ref_sys`` 和 ``geometry_columns`` 的 " "``SpatialRefSys`` 和 ``GeometryColumns`` 模型。" msgid "" "While these aliases are still provided, they are only for the *default* " "database connection and exist only if the default connection is using a " "supported spatial database backend." msgstr "" "尽管仍然提供这些别名,但它们仅适用于 *默认* 数据库连接,并且仅在默认连接使用" "受支持的空间数据库后端时存在。" msgid "" "Because the table structure of the OGC spatial metadata tables differs " "across spatial databases, the ``SpatialRefSys`` and ``GeometryColumns`` " "models can no longer be associated with the ``gis`` application name. Thus, " "no models will be returned when using the ``get_models`` method in the " "following example:" msgstr "" "由于不同空间数据库的 OGC 空间元数据表的表结构不同,因此不能再将 " "``SpatialRefSys`` 和 ``GeometryColumns`` 模型与 ``gis`` 应用程序名称关联。因" "此,在以下示例中使用 ``get_models`` 方法将不会返回任何模型:" msgid "" "To get the correct ``SpatialRefSys`` and ``GeometryColumns`` for your " "spatial database use the methods provided by the spatial backend:" msgstr "" "要获取与你的空间数据库匹配的正确的 ``SpatialRefSys`` 和 ``GeometryColumns``," "请使用空间后端提供的方法:" msgid "" "When using the models returned from the ``spatial_ref_sys()`` and " "``geometry_columns()`` method, you'll still need to use the correct database " "alias when querying on the non-default connection. In other words, to ensure " "that the models in the example above use the correct database::" msgstr "" "当使用从 ``spatial_ref_sys()`` 和 ``geometry_columns()`` 方法返回的模型时,仍" "然需要在查询非默认连接时使用正确的数据库别名。换句话说,为了确保上面示例中的" "模型使用正确的数据库:" msgid "Language code ``no``" msgstr "语言代码 ``no``" msgid "" "The currently used language code for Norwegian Bokmål ``no`` is being " "replaced by the more common language code ``nb``." msgstr "" "目前使用的挪威博克马尔语的语言代码 ``no`` 正在被更常见的语言代码 ``nb`` 所取" "代。" msgid "Function-based template loaders" msgstr "基于函数的模板加载器" msgid "" "Django 1.2 changes the template loading mechanism to use a class-based " "approach. Old style function-based template loaders will still work, but " "should be updated to use the new class-based template loaders." msgstr "" "Django 1.2 将模板加载机制更改为使用基于类的方法。旧式基于函数的模板加载器仍然" "可以工作,但应该更新为使用新的基于类的模板加载器。" msgid "Django 1.2.1 release notes" msgstr "Django 1.2.1 版本发行说明" msgid "" "Django 1.2.1 was released almost immediately after 1.2.0 to correct two " "small bugs: one was in the documentation packaging script, the other was a :" "ticket:`bug <13560>` that affected datetime form field widgets when " "localization was enabled." msgstr "" "Django 1.2.1 几乎在 1.2.0 发布后立即发布,用于修复两个小问题:一个在文档打包" "脚本中,另一个是在启用本地化时影响日期时间表单字段小部件的 :ticket:`错误 " "<13560>`。" msgid "Django 1.2.2 release notes" msgstr "Django 1.2.2 版本发行说明" msgid "Welcome to Django 1.2.2!" msgstr "欢迎来到 Django 1.2.2 版本!" msgid "" "This is the second \"bugfix\" release in the Django 1.2 series, improving " "the stability and performance of the Django 1.2 codebase." msgstr "" "这是 Django 1.2 系列中的第二个“修复错误”的版本,提高了 Django 1.2 代码库的稳" "定性和性能。" msgid "" "Django 1.2.2 maintains backwards compatibility with Django 1.2.1, but " "contain a number of fixes and other improvements. Django 1.2.2 is a " "recommended upgrade for any development or deployment currently using or " "targeting Django 1.2." msgstr "" "Django 1.2.2 保持了与 Django 1.2.1 的向后兼容性,但包含了许多修复和其他改进。" "对于当前使用或针对 Django 1.2 的任何开发或部署,建议升级到 Django 1.2.2 。" msgid "" "For full details on the new features, backwards incompatibilities, and " "deprecated features in the 1.2 branch, see the :doc:`/releases/1.2`." msgstr "" "有关 1.2 分支的新功能、向后不兼容性和已弃用功能的详细信息,请参阅 :doc:`/" "releases/1.2`。" msgid "" "Ordinarily, a point release would not include new features, but in the case " "of Django 1.2.2, we have made an exception to this rule." msgstr "" "通常情况下,一个小版本更新不会包含新功能,但在 Django 1.2.2 的情况下,我们对" "这个规则做了一个例外。" msgid "" "In order to test a bug fix that forms part of the 1.2.2 release, it was " "necessary to add a feature -- the ``enforce_csrf_checks`` flag -- to the :" "ref:`test client `. This flag forces the test client to perform " "full CSRF checks on forms. The default behavior of the test client hasn't " "changed, but if you want to do CSRF checks with the test client, it is now " "possible to do so." msgstr "" "为了测试 1.2.2 版本中的一个错误修复,必须添加一个功能——" "``enforce_csrf_checks`` 标志——到 :ref:`测试客户端 `。这个标志强" "制测试客户端对表单执行完整的 CSRF 检查。测试客户端的默认行为没有改变,但如果" "你想使用测试客户端进行 CSRF 检查,现在是可以做到的。" msgid "Django 1.2.3 release notes" msgstr "Django 1.2.3 版本发行说明" msgid "" "Django 1.2.3 fixed a couple of release problems in the 1.2.2 release and was " "released two days after 1.2.2." msgstr "" "Django 1.2.3 修复了 1.2.2 版本中的一些发布问题,并在 1.2.2 发布两天后发布。" msgid "This release corrects the following problems:" msgstr "此版本纠正了以下问题:" msgid "" "The :commit:`patch <7f84657b6b2243cc787bdb9f296710c8d13ad0bd>` applied for " "the security issue covered in Django 1.2.2 caused issues with non-ASCII " "responses using CSRF tokens." msgstr "" "应用于 Django 1.2.2 中涵盖的安全问题的 :commit:`补丁 " "<7f84657b6b2243cc787bdb9f296710c8d13ad0bd>` 导致在使用 CSRF 令牌的非 ASCII 响" "应时出现问题。" msgid "" "The patch also caused issues with some forms, most notably the user-editing " "forms in the Django administrative interface." msgstr "" "此补丁还导致了一些表单出现问题,尤其是 Django 管理界面中的用户编辑表单。" msgid "The packaging manifest did not contain the full list of required files." msgstr "打包清单中未包含所需文件的完整列表。" msgid "Django 1.2.4 release notes" msgstr "Django 1.2.4 版本发行说明" msgid "Welcome to Django 1.2.4!" msgstr "欢迎来到 Django 1.2.4 版本!" msgid "" "This is the fourth \"bugfix\" release in the Django 1.2 series, improving " "the stability and performance of the Django 1.2 codebase." msgstr "" "这是 Django 1.2 系列中的第四个“修复错误”的版本,提高了 Django 1.2 代码库的稳" "定性和性能。" msgid "" "With one exception, Django 1.2.4 maintains backwards compatibility with " "Django 1.2.3. It also contains a number of fixes and other improvements. " "Django 1.2.4 is a recommended upgrade for any development or deployment " "currently using or targeting Django 1.2." msgstr "" "除一个例外外,Django 1.2.4 保持了与 Django 1.2.3 的向后兼容性。它还包含了许多" "修复和其他改进。对于当前使用或针对 Django 1.2 的任何开发或部署,建议升级到 " "Django 1.2.4 。" msgid "" "Ordinarily, a point release would not include new features, but in the case " "of Django 1.2.4, we have made an exception to this rule." msgstr "" "通常情况下,一个小版本更新不会包含新功能,但在 Django 1.2.4 的情况下,我们对" "这个规则做了一个例外。" msgid "" "One of the bugs fixed in Django 1.2.4 involves a set of circumstances " "whereby a running a test suite on a multiple database configuration could " "cause the original source database (i.e., the actual production database) to " "be dropped, causing catastrophic loss of data. In order to provide a fix for " "this problem, it was necessary to introduce a new setting -- :setting:" "`TEST_DEPENDENCIES` -- that allows you to define any creation order " "dependencies in your database configuration." msgstr "" "Django 1.2.4 中修复的一个 bug 涉及在多数据库配置上运行测试套件时可能导致原始" "源数据库(即实际的生产数据库)被删除,从而导致数据灾难性丧失的一组情况。为了" "解决这个问题,需要引入一个新的设置 -- :setting:`TEST_DEPENDENCIES` -- 允许您" "在数据库配置中定义任何创建顺序依赖项。" msgid "" "Most users -- even users with multiple-database configurations -- need not " "be concerned about the data loss bug, or the manual configuration of :" "setting:`TEST_DEPENDENCIES`. See the :ticket:`original problem report " "<14415>` documentation on :ref:`controlling the creation order of test " "databases ` for details." msgstr "" "大多数用户,甚至使用多数据库配置的用户,无需担心数据丢失的 bug,也不需要手动" "配置 :setting:`TEST_DEPENDENCIES`。有关详细信息,请参阅 :ticket:`原始问题报" "告 <14415>` 文档中的 :ref:`控制测试数据库创建顺序 `。" msgid "" "The function-based :setting:`TEST_RUNNER` previously used to execute the " "GeoDjango test suite, ``django.contrib.gis.tests.run_gis_tests``, was " "finally deprecated in favor of a class-based test runner, ``django.contrib." "gis.tests.GeoDjangoTestSuiteRunner``, added in this release." msgstr "" "用于执行 GeoDjango 测试套件的基于函数的 :setting:`TEST_RUNNER`,``django." "contrib.gis.tests.run_gis_tests``,已经被弃用,改用了一个基于类的测试运行器," "``django.contrib.gis.tests.GeoDjangoTestSuiteRunner``,这个变化是在这个版本中" "添加的。" msgid "" "In addition, the GeoDjango test suite is now included when :ref:`running the " "Django test suite ` with ``runtests.py`` and using :ref:" "`spatial database backends `." msgstr "" "此外,在使用 ``runtests.py`` 运行 :ref:`Django 测试套件 ` 并使用 :ref:`空间数据库后端 ` 时,现在已经包含了 " "GeoDjango 测试套件。" msgid "Django 1.2.5 release notes" msgstr "Django 1.2.5 版本发行说明" msgid "Welcome to Django 1.2.5!" msgstr "欢迎来到 Django 1.2.5 版本!" msgid "" "This is the fifth \"bugfix\" release in the Django 1.2 series, improving the " "stability and performance of the Django 1.2 codebase." msgstr "" "这是 Django 1.2 系列中的第五个“修复错误”的版本,提高了 Django 1.2 代码库的稳" "定性和性能。" msgid "" "With four exceptions, Django 1.2.5 maintains backwards compatibility with " "Django 1.2.4. It also contains a number of fixes and other improvements. " "Django 1.2.5 is a recommended upgrade for any development or deployment " "currently using or targeting Django 1.2." msgstr "" "除四个例外外,Django 1.2.5 保持了与 Django 1.2.4 的向后兼容性。它还包含了许多" "修复和其他改进。对于当前使用或针对 Django 1.2 的任何开发或部署,建议升级到 " "Django 1.2.5 。" msgid "FileField no longer deletes files" msgstr "FileField 不再删除文件" msgid "" "In earlier Django versions, when a model instance containing a :class:" "`~django.db.models.FileField` was deleted, :class:`~django.db.models." "FileField` took it upon itself to also delete the file from the backend " "storage. This opened the door to several potentially serious data-loss " "scenarios, including rolled-back transactions and fields on different models " "referencing the same file. In Django 1.2.5, :class:`~django.db.models." "FileField` will never delete files from the backend storage. If you need " "cleanup of orphaned files, you'll need to handle it yourself (for instance, " "with a custom management command that can be run manually or scheduled to " "run periodically via e.g. cron)." msgstr "" "在较早的 Django 版本中,当删除包含 :class:`~django.db.models.FileField` 的模" "型实例时,:class:`~django.db.models.FileField` 会自行从后端存储中删除文件。这" "为几种潜在严重的数据丢失情况敞开了大门,包括回滚的事务和不同模型上的字段引用" "相同的文件。在 Django 1.2.5 中,:class:`~django.db.models.FileField` 将永远不" "会从后端存储中删除文件。如果需要清理孤立的文件,您需要自行处理(例如,使用一" "个自定义的管理命令,可以手动运行或通过 cron 定期运行)。" msgid "Use of custom SQL to load initial data in tests" msgstr "在测试中使用自定义 SQL 加载初始数据" msgid "" "Django provides a custom SQL hooks as a way to inject hand-crafted SQL into " "the database synchronization process. One of the possible uses for this " "custom SQL is to insert data into your database. If your custom SQL contains " "``INSERT`` statements, those insertions will be performed every time your " "database is synchronized. This includes the synchronization of any test " "databases that are created when you run a test suite." msgstr "" "Django 提供了自定义 SQL 钩子作为将手工编写的 SQL 注入到数据库同步过程中的一种" "方式。这个自定义 SQL 的一个可能用途是将数据插入到数据库中。如果您的自定义 " "SQL 包含 ``INSERT`` 语句,那么这些插入操作将在每次数据库同步时执行。这包括在" "运行测试套件时创建的任何测试数据库的同步。" msgid "" "However, in the process of testing the Django 1.3, it was discovered that " "this feature has never completely worked as advertised. When using database " "backends that don't support transactions, or when using a " "TransactionTestCase, data that has been inserted using custom SQL will not " "be visible during the testing process." msgstr "" "然而,在测试 Django 1.3 的过程中,发现这个功能从未完全按照宣传的那样工作。当" "使用不支持事务的数据库后端或使用 TransactionTestCase 时,使用自定义 SQL 插入" "的数据在测试过程中将不可见。" msgid "" "Unfortunately, there was no way to rectify this problem without introducing " "a backwards incompatibility. Rather than leave SQL-inserted initial data in " "an uncertain state, Django now enforces the policy that data inserted by " "custom SQL will *not* be visible during testing." msgstr "" "不幸的是,要纠正这个问题,没有办法不引入向后不兼容性。与其让通过自定义 SQL 插" "入的初始数据处于不确定的状态,Django 现在强制执行一个策略,即通过自定义 SQL " "插入的数据在测试期间将 *不* 可见。" msgid "" "This change only affects the testing process. You can still use custom SQL " "to load data into your production database as part of the ``syncdb`` " "process. If you require data to exist during test conditions, you should " "either insert it using :ref:`test fixtures `, or " "using the ``setUp()`` method of your test case." msgstr "" "这个更改只影响测试过程。您仍然可以使用自定义 SQL 在 ``syncdb`` 进程的一部分中" "将数据加载到生产数据库中。如果您需要在测试条件下存在数据,您应该使用 :ref:`测" "试固件 ` 来插入它,或者使用您的测试用例的 " "``setUp()`` 方法。" msgid "ModelAdmin.lookup_allowed signature changed" msgstr "ModelAdmin.lookup_allowed 签名已更改" msgid "" "Django 1.2.4 introduced a method ``lookup_allowed`` on ``ModelAdmin``, to " "cope with a security issue (changeset :commit:`[15033] " "<85207a245bf09fdebe486b4c7bbcb65300f2a693>`). Although this method was never " "documented, it seems some people have overridden ``lookup_allowed``, " "especially to cope with regressions introduced by that changeset. While the " "method is still undocumented and not marked as stable, it may be helpful to " "know that the signature of this function has changed." msgstr "" "Django 1.2.4 引入了一个名为 ``lookup_allowed`` 的方法,用于在 ``ModelAdmin`` " "上处理一个安全问题(changeset :commit:`[15033] " "<85207a245bf09fdebe486b4c7bbcb65300f2a693>`)。尽管这个方法从未被文档化,但似" "乎有一些人已经重写了 ``lookup_allowed``,尤其是为了应对该 changeset 引入的回" "归问题。虽然这个方法仍然未被文档化并且未标记为稳定,但了解该函数的签名已发生" "变化可能会有所帮助。" msgid "Django 1.2.6 release notes" msgstr "Django 1.2.6 版本发行说明" msgid "*September 9, 2011*" msgstr "*2011 年 9 月 9 日*" msgid "Welcome to Django 1.2.6!" msgstr "欢迎来到 Django 1.2.6 版本!" msgid "" "This is the sixth bugfix/security release in the Django 1.2 series, fixing " "several security issues present in Django 1.2.5. Django 1.2.6 is a " "recommended upgrade for all users of any Django release in the 1.2.X series." msgstr "" "这是 Django 1.2 系列中的第六个修复错误/安全性发布,修复了 Django 1.2.5 中存在" "的几个安全问题。对于 1.2.X 系列中任何 Django 版本的所有用户,建议升级到 " "Django 1.2.6 。" msgid "" "For a full list of issues addressed in this release, see the `security " "advisory`_." msgstr "要查看此版本中解决的所有问题的完整列表,请参阅 `安全公告`_。" msgid "Django 1.2.7 release notes" msgstr "Django 1.2.7 版本发行说明" msgid "*September 10, 2011*" msgstr "*2011 年 9 月 10 日*" msgid "Welcome to Django 1.2.7!" msgstr "欢迎来到 Django 1.2.7 版本!" msgid "" "This is the seventh bugfix/security release in the Django 1.2 series. It " "replaces Django 1.2.6 due to problems with the 1.2.6 release tarball. Django " "1.2.7 is a recommended upgrade for all users of any Django release in the " "1.2.X series." msgstr "" "这是 Django 1.2 系列中的第七个修复错误/安全性发布。由于 1.2.6 版本压缩包存在" "问题,它取代了 Django 1.2.6 。对于 1.2.X 系列中任何 Django 版本的所有用户,建" "议升级到 Django 1.2.7 。" msgid "For more information, see the `release advisory`_." msgstr "有关更多信息,请参阅 `发布公告`_。" msgid "Django 1.3 release notes" msgstr "Django 1.3 版本发行说明" msgid "*March 23, 2011*" msgstr "*2011 年 3 月 23 日*" msgid "Welcome to Django 1.3!" msgstr "欢迎来到 Django 1.3 版本!" msgid "" "Nearly a year in the making, Django 1.3 includes quite a few :ref:`new " "features ` and plenty of bug fixes and improvements to " "existing features. These release notes cover the new features in 1.3, as " "well as some :ref:`backwards-incompatible changes ` you'll want to be aware of when upgrading from Django 1.2 or " "older versions." msgstr "" "经过将近一年的努力,Django 1.3 包括了相当多的 :ref:`新功能 `," "以及对现有功能的大量错误修复和改进。这些发布说明涵盖了 1.3 中的新功能,以及" "从 Django 1.2 或更早版本升级时需要注意的一些 :ref:`向后不兼容的更改 " "`。" msgid "" "Django 1.3's focus has mostly been on resolving smaller, long-standing " "feature requests, but that hasn't prevented a few fairly significant new " "features from landing, including:" msgstr "" "Django 1.3 的重点主要是解决较小的、长期存在的功能需求,但这并未阻止一些相当重" "要的新功能的实现,包括:" msgid "A framework for writing `class-based views`_." msgstr "一个用于编写 `基于类的视图`_ 的框架。" msgid "Built-in support for `using Python's logging facilities`_." msgstr "内置支持 `使用 Python 的日志记录工具`_。" msgid "Contrib support for `easy handling of static files`_." msgstr "为 `静态文件的简单处理`_ 提供的贡献支持。" msgid "" "Django's testing framework now supports (and ships with a copy of) `the " "unittest2 library`_." msgstr "Django 的测试框架现在支持(并随附了一份) `unittest2 库`_。" msgid "" "Wherever possible, new features are introduced in a backwards-compatible " "manner per :doc:`our API stability policy ` policy. As " "a result of this policy, Django 1.3 :ref:`begins the deprecation process for " "some features `." msgstr "" "在可能的情况下,新功能都按照 :doc:`我们的 API 稳定性政策 ` 以向后兼容的方式引入。由于这个政策,Django 1.3 :ref:`开始了某些功" "能的弃用过程 `。" msgid "" "The release of Django 1.2 was notable for having the first shift in Django's " "Python compatibility policy; prior to Django 1.2, Django supported any 2.x " "version of Python from 2.3 up. As of Django 1.2, the minimum requirement was " "raised to Python 2.4." msgstr "" "Django 1.2 的发布引人注目,因为它是 Django Python 兼容性政策的第一个变化;在 " "Django 1.2 之前,Django 支持从 2.3 到任何 2.x 版本的 Python 。从 Django 1.2 " "开始,最低要求提高到 Python 2.4 。" msgid "" "Django 1.3 continues to support Python 2.4, but will be the final Django " "release series to do so; beginning with Django 1.4, the minimum supported " "Python version will be 2.5. A document outlining our full timeline for " "deprecating Python 2.x and moving to Python 3.x will be published shortly " "after the release of Django 1.3." msgstr "" "Django 1.3 继续支持 Python 2.4,但这将是最后一个支持该版本的 Django 发布系" "列;从 Django 1.4 开始,最低支持的 Python 版本将是 2.5 。在 Django 1.3 发布后" "不久,我们将发布一份详细说明废弃 Python 2.x 并转向 Python 3.x 的完整时间表的" "文档。" msgid "What's new in Django 1.3" msgstr "Django 1.3 新特性" msgid "Class-based views" msgstr "基于类的视图" msgid "" "Django 1.3 adds a framework that allows you to use a class as a view. This " "means you can compose a view out of a collection of methods that can be " "subclassed and overridden to provide common views of data without having to " "write too much code." msgstr "" "Django 1.3 添加了一个框架,允许您使用类作为视图。这意味着您可以使用一组方法组" "成一个视图,这些方法可以被子类化和重写,以提供数据的通用视图,而无需编写太多" "代码。" msgid "" "Analogs of all the old function-based generic views have been provided, " "along with a completely generic view base class that can be used as the " "basis for reusable applications that can be easily extended." msgstr "" "已经提供了所有旧的基于函数的通用视图的类似物,以及一个完全通用的视图基类,可" "以用作可重用应用程序的基础,这些应用程序可以很容易地扩展。" msgid "" "See :doc:`the documentation on class-based generic views` for more details. There is also a document to help you " "`convert your function-based generic views to class-based views `_." msgstr "" "有关更多详细信息,请参阅 :doc:`关于基于类的通用视图的文档`。还有一份文档可以帮助您将 `基于函数的通用视图转换为基于类" "的视图 `_。" msgid "Logging" msgstr "日志" msgid "" "Django 1.3 adds framework-level support for Python's ``logging`` module. " "This means you can now easily configure and control logging as part of your " "Django project. A number of logging handlers and logging calls have been " "added to Django's own code as well -- most notably, the error emails sent on " "an HTTP 500 server error are now handled as a logging activity. See :doc:" "`the documentation on Django's logging interface ` for more " "details." msgstr "" "Django 1.3 在框架级别添加了对 Python 的 ``logging`` 模块的支持。这意味着现在" "您可以轻松地在您的 Django 项目中配置和控制日志记录。此外,Django 的代码中还添" "加了许多日志处理程序和日志调用,最显著的是,在发生 HTTP 500 服务器错误时发送" "的错误邮件现在被处理为日志活动。有关更多详细信息,请参阅 :doc:`关于 Django 日" "志记录接口的文档 `。" msgid "Extended static files handling" msgstr "扩展静态文件处理" msgid "" "Django 1.3 ships with a new contrib app -- ``django.contrib.staticfiles`` -- " "to help developers handle the static media files (images, CSS, JavaScript, " "etc.) that are needed to render a complete web page." msgstr "" "Django 1.3 随附了一个新的贡献应用程序 -- ``django.contrib.staticfiles`` -- 以" "帮助开发人员处理渲染完整网页所需的静态媒体文件(图像、CSS、JavaScript 等)。" msgid "" "In previous versions of Django, it was common to place static assets in :" "setting:`MEDIA_ROOT` along with user-uploaded files, and serve them both at :" "setting:`MEDIA_URL`. Part of the purpose of introducing the ``staticfiles`` " "app is to make it easier to keep static files separate from user-uploaded " "files. Static assets should now go in ``static/`` subdirectories of your " "apps or in other static assets directories listed in :setting:" "`STATICFILES_DIRS`, and will be served at :setting:`STATIC_URL`." msgstr "" "在以前的 Django 版本中,通常会将静态资源与用户上传的文件一起放在 :setting:" "`MEDIA_ROOT` 中,并同时在 :setting:`MEDIA_URL` 上提供它们。引入 " "``staticfiles`` 应用程序的部分目的是使将静态文件与用户上传的文件分开更加容" "易。现在,静态资源应该放在您的应用程序的 ``static/`` 子目录中或在 :setting:" "`STATICFILES_DIRS` 中列出的其他静态资源目录中,并将在 :setting:`STATIC_URL` " "上提供。" msgid "" "See the :doc:`reference documentation of the app ` " "for more details or learn how to :doc:`manage static files `." msgstr "" "有关更多详细信息,请参阅该应用程序的 :doc:`参考文档 ` 或学习如何 :doc:`管理静态文件 `。" msgid "``unittest2`` support" msgstr "``unittest2`` 支持" msgid "" "Python 2.7 introduced some major changes to the ``unittest`` library, adding " "some extremely useful features. To ensure that every Django project can " "benefit from these new features, Django ships with a copy of :pypi:" "`unittest2`, a copy of the Python 2.7 ``unittest`` library, backported for " "Python 2.4 compatibility." msgstr "" "Python 2.7 引入了对 ``unittest`` 库的一些重大更改,添加了一些非常有用的功能。" "为了确保每个 Django 项目都能受益于这些新功能,Django 随附了 :pypi:" "`unittest2` 的副本,这是 Python 2.7 ``unittest`` 库的一个副本,专为 Python " "2.4 兼容性而进行了回退。" msgid "" "To access this library, Django provides the ``django.utils.unittest`` module " "alias. If you are using Python 2.7, or you have installed ``unittest2`` " "locally, Django will map the alias to the installed version of the " "``unittest`` library. Otherwise, Django will use its own bundled version of " "``unittest2``." msgstr "" "要访问这个库,Django 提供了 ``django.utils.unittest`` 模块别名。如果您使用的" "是 Python 2.7,或者已经在本地安装了 ``unittest2``,Django 会将别名映射到已安" "装的 ``unittest`` 库的版本。否则,Django 将使用其自带的 ``unittest2`` 版本。" msgid "To take advantage of this alias, simply use::" msgstr "要利用这个别名,只需使用:" msgid "wherever you would have historically used::" msgstr "在你过去曾经使用过的地方:" msgid "" "If you want to continue to use the base ``unittest`` library, you can -- you " "just won't get any of the nice new ``unittest2`` features." msgstr "" "如果您想继续使用基本的 ``unittest`` 库,您可以这样做,只是您将不会获得任何新" "的 ``unittest2`` 功能。" msgid "Transaction context managers" msgstr "事务上下文管理器" msgid "" "Users of Python 2.5 and above may now use transaction management functions " "as context managers. For example::" msgstr "" "Python 2.5 及以上版本的用户现在可以将事务管理函数用作上下文管理器。例如:" msgid "Configurable delete-cascade" msgstr "可配置的级联删除" msgid "" ":class:`~django.db.models.ForeignKey` and :class:`~django.db.models." "OneToOneField` now accept an :attr:`~django.db.models.ForeignKey.on_delete` " "argument to customize behavior when the referenced object is deleted. " "Previously, deletes were always cascaded; available alternatives now include " "set null, set default, set to any value, protect, or do nothing." msgstr "" ":class:`~django.db.models.ForeignKey` 和 :class:`~django.db.models." "OneToOneField` 现在接受一个 :attr:`~django.db.models.ForeignKey.on_delete` 参" "数,用于在引用的对象被删除时自定义行为。以前,删除操作总是级联的;现在可用的" "替代方案包括设置为 null、设置为默认值、设置为任何值、保护或不采取任何行动。" msgid "" "For more information, see the :attr:`~django.db.models.ForeignKey.on_delete` " "documentation." msgstr "" "有关更多信息,请参阅 :attr:`~django.db.models.ForeignKey.on_delete` 的文档。" msgid "Contextual markers and comments for translatable strings" msgstr "可翻译字符串的上下文标记和注释" msgid "" "For translation strings with ambiguous meaning, you can now use the " "``pgettext`` function to specify the context of the string." msgstr "" "对于具有模糊含义的翻译字符串,现在可以使用 ``pgettext`` 函数来指定字符串的上" "下文。" msgid "" "And if you just want to add some information for translators, you can also " "add special translator comments in the source." msgstr "" "如果你只想为翻译者添加一些信息,你还可以在源代码中添加特殊的翻译者注释。" msgid "" "For more information, see :ref:`contextual-markers` and :ref:`translator-" "comments`." msgstr "有关更多信息,请参阅 :ref:`上下文标记` 和 :ref:`翻译者注释`。" msgid "Improvements to built-in template tags" msgstr "内置模板标签的改进" msgid "" "A number of improvements have been made to Django's built-in template tags:" msgstr "对 Django 内置模板标签进行了一些改进:" msgid "" "The :ttag:`include` tag now accepts a ``with`` option, allowing you to " "specify context variables to the included template" msgstr "" ":ttag:`include` 标签现在接受一个 ``with`` 选项,允许您指定要传递给包含的模板" "的上下文变量。" msgid "" "The :ttag:`include` tag now accepts an ``only`` option, allowing you to " "exclude the current context from the included context" msgstr "" ":ttag:`include` 标签现在接受一个 ``only`` 选项,允许您将当前上下文从包含的上" "下文中排除在外。" msgid "" "The :ttag:`with` tag now allows you to define multiple context variables in " "a single :ttag:`with` block." msgstr "" ":ttag:`with` 标签现在允许您在单个 :ttag:`with` 块中定义多个上下文变量。" msgid "" "The :ttag:`load` tag now accepts a ``from`` argument, allowing you to load a " "single tag or filter from a library." msgstr "" ":ttag:`load` 标签现在接受一个 ``from`` 参数,允许您从一个库中加载单个标签或过" "滤器。" msgid "TemplateResponse" msgstr "模板响应" msgid "" "It can sometimes be beneficial to allow decorators or middleware to modify a " "response *after* it has been constructed by the view. For example, you may " "want to change the template that is used, or put additional data into the " "context." msgstr "" "有时允许装饰器或中间件在视图构建响应之后修改响应可能是有益的。例如,您可能希" "望更改所使用的模板,或将额外的数据放入上下文中。" msgid "" "However, you can't (easily) modify the content of a basic :class:`~django." "http.HttpResponse` after it has been constructed. To overcome this " "limitation, Django 1.3 adds a new :class:`~django.template.response." "TemplateResponse` class. Unlike basic :class:`~django.http.HttpResponse` " "objects, :class:`~django.template.response.TemplateResponse` objects retain " "the details of the template and context that was provided by the view to " "compute the response. The final output of the response is not computed until " "it is needed, later in the response process." msgstr "" "然而,您不能(轻松地)在构建后修改基本的 :class:`~django.http.HttpResponse` " "内容。为了克服这个限制,Django 1.3 添加了一个新的 :class:`~django.template." "response.TemplateResponse` 类。与基本的 :class:`~django.http.HttpResponse` 对" "象不同,:class:`~django.template.response.TemplateResponse` 对象保留了视图提" "供的模板和上下文的详细信息,以计算响应。响应的最终输出直到后面的响应过程中才" "会计算。" msgid "" "For more details, see the :doc:`documentation ` on " "the :class:`~django.template.response.TemplateResponse` class." msgstr "" "有关更多详细信息,请参阅 :class:`~django.template.response.TemplateResponse` " "类的 :doc:`文档 `。" msgid "Caching changes" msgstr "缓存更改" msgid "" "Django 1.3 sees the introduction of several improvements to the Django's " "caching infrastructure." msgstr "Django 1.3 引入了对 Django 缓存基础设施的若干改进。" msgid "" "Firstly, Django now supports multiple named caches. In the same way that " "Django 1.2 introduced support for multiple database connections, Django 1.3 " "allows you to use the new :setting:`CACHES` setting to define multiple named " "cache connections." msgstr "" "首先,Django 现在支持多个命名缓存。与 Django 1.2 引入多个数据库连接支持的方式" "类似,Django 1.3 允许您使用新的 :setting:`CACHES` 设置来定义多个命名的缓存连" "接。" msgid "" "Secondly, :ref:`versioning `, :ref:`site-wide prefixing " "` and :ref:`transformation ` " "have been added to the cache API." msgstr "" "其次,缓存 API 中添加了 :ref:`版本化 `、:ref:`站点范围的前" "缀 ` 和 :ref:`转换 ` 功能。" msgid "" "Thirdly, :ref:`cache key creation ` has been updated to " "take the request query string into account on ``GET`` requests." msgstr "" "第三,已更新 :ref:`缓存键创建 `,以考虑 ``GET`` 请求中的" "请求查询字符串。" msgid "" "Finally, support for pylibmc_ has been added to the memcached cache backend." msgstr "最后,已经将对 pylibmc_ 的支持添加到了 memcached 缓存后端。" msgid "" "For more details, see the :doc:`documentation on caching in Django`." msgstr "有关更多详细信息,请参阅 :doc:`Django 中的缓存文档 `。" msgid "Permissions for inactive users" msgstr "对非活跃用户的权限" msgid "" "If you provide a custom auth backend with ``supports_inactive_user`` set to " "``True``, an inactive ``User`` instance will check the backend for " "permissions. This is useful for further centralizing the permission " "handling. See the :doc:`authentication docs ` for more " "details." msgstr "" "如果您提供一个自定义的身份验证后端,并将 ``supports_inactive_user`` 设置为 " "``True``,则不活动的 ``User`` 实例将检查后端以获取权限。这对于进一步集中权限" "处理非常有用。有关更多详细信息,请参阅 :doc:`身份验证文档 `。" msgid "" "The GeoDjango test suite is now included when :ref:`running the Django test " "suite ` with ``runtests.py`` when using :ref:`spatial " "database backends `." msgstr "" "使用 :ref:`空间数据库后端 ` 来 :ref:`运行 Django 测试套件 " "` 时,GeoDjango 测试套件现在已包含在 ``runtests.py`` 中。" msgid ":setting:`MEDIA_URL` and :setting:`STATIC_URL` must end in a slash" msgstr ":setting:`MEDIA_URL` 和 :setting:`STATIC_URL` 必须以斜杠结尾。" msgid "" "Previously, the :setting:`MEDIA_URL` setting only required a trailing slash " "if it contained a suffix beyond the domain name." msgstr "" "之前,:setting:`MEDIA_URL` 设置只有在包含域名之后的后缀时才需要一个尾随斜杠。" msgid "" "A trailing slash is now *required* for :setting:`MEDIA_URL` and the new :" "setting:`STATIC_URL` setting as long as it is not blank. This ensures there " "is a consistent way to combine paths in templates." msgstr "" "现在,只要不是空白的情况下,:setting:`MEDIA_URL` 和新的 :setting:" "`STATIC_URL` 设置都需要一个尾随斜杠。这确保了在模板中组合路径的一致方式。" msgid "" "Project settings which provide either of both settings without a trailing " "slash will now raise a ``PendingDeprecationWarning``." msgstr "" "提供了没有尾随斜杠的任何一个或两个设置的项目设置现在会引发一个 " "``PendingDeprecationWarning``。" msgid "" "In Django 1.4 this same condition will raise ``DeprecationWarning``, and in " "Django 1.5 will raise an ``ImproperlyConfigured`` exception." msgstr "" "在 Django 1.4 中,相同的条件将引发 ``DeprecationWarning``,而在 Django 1.5 中" "将引发 ``ImproperlyConfigured`` 异常。" msgid "Everything else" msgstr "其他所有内容" msgid "" "Django :doc:`1.1 <1.1>` and :doc:`1.2 <1.2>` added lots of big ticket items " "to Django, like multiple-database support, model validation, and a session-" "based messages framework. However, this focus on big features came at the " "cost of lots of smaller features." msgstr "" "Django :doc:`1.1 <1.1>` 和 :doc:`1.2 <1.2>` 在 Django 中引入了许多重要的功" "能,如多数据库支持、模型验证和基于会话的消息框架。然而,这种对重要功能的关注" "也导致了许多较小功能的牺牲。" msgid "" "To compensate for this, the focus of the Django 1.3 development process has " "been on adding lots of smaller, long standing feature requests. These " "include:" msgstr "" "为了弥补这一点,Django 1.3 开发过程的重点是添加许多较小的、长期存在的功能需" "求。这些包括:" msgid "" "Improved tools for accessing and manipulating the current :class:`~django." "contrib.sites.models.Site` object in :doc:`the sites framework `." msgstr "" "在 :doc:`站点框架 ` 中,改进了访问和操作当前 :class:" "`~django.contrib.sites.models.Site` 对象的工具。" msgid "A :class:`~django.test.RequestFactory` for mocking requests in tests." msgstr "在测试中用于模拟请求的 :class:`~django.test.RequestFactory`。" msgid "" "A new test assertion -- :meth:`~django.test.TransactionTestCase." "assertNumQueries` -- making it easier to test the database activity " "associated with a view." msgstr "" "一个新的测试断言 -- :meth:`~django.test.TransactionTestCase." "assertNumQueries` -- 使得更容易测试与视图相关的数据库活动。" msgid "" "Support for lookups spanning relations in admin's :attr:`~django.contrib." "admin.ModelAdmin.list_filter`." msgstr "" "在管理员的 :attr:`~django.contrib.admin.ModelAdmin.list_filter` 中支持跨关系" "的查询。" msgid "Support for HttpOnly_ cookies." msgstr "支持 HttpOnly_ cookies。" msgid "" ":meth:`~django.core.mail.mail_admins()` and :meth:`~django.core.mail." "mail_managers()` now support easily attaching HTML content to messages." msgstr "" "现在,:meth:`~django.core.mail.mail_admins()` 和 :meth:`~django.core.mail." "mail_managers()` 支持轻松附加 HTML 内容到消息中。" msgid ":class:`~django.core.mail.EmailMessage` now supports CC's." msgstr ":class:`~django.core.mail.EmailMessage` 现在支持抄送 (CC)。" msgid "" "Error emails now include more of the detail and formatting of the debug " "server error page." msgstr "错误邮件现在包含了更多关于调试服务器错误页面的详细信息和格式。" msgid "" ":meth:`~django.template.Library.simple_tag` now accepts a ``takes_context`` " "argument, making it easier to write simple template tags that require access " "to template context." msgstr "" ":meth:`~django.template.Library.simple_tag` 现在接受一个 ``takes_context`` 参" "数,这使得编写需要访问模板上下文的简单模板标签变得更加容易。" msgid "" "A new :meth:`~django.shortcuts.render()` shortcut -- an alternative to " "``django.shortcuts.render_to_response()`` providing a :class:`~django." "template.RequestContext` by default." msgstr "" "一个新的 :meth:`~django.shortcuts.render()` 快捷方式 -- 作为 ``django." "shortcuts.render_to_response()`` 的替代,默认提供一个 :class:`~django." "template.RequestContext`。" msgid "" "Support for combining :class:`F expressions ` with " "``timedelta`` values when retrieving or updating database values." msgstr "" "支持在检索或更新数据库值时将 :class:`F 表达式 ` 与 " "``timedelta`` 值组合使用。" msgid "Backwards-incompatible changes in 1.3" msgstr "1.3 中的向后不兼容更改" msgid "CSRF validation now applies to AJAX requests" msgstr "CSRF 验证现在适用于 AJAX 请求" msgid "" "Prior to Django 1.2.5, Django's CSRF-prevention system exempted AJAX " "requests from CSRF verification; due to `security issues`_ reported to us, " "however, *all* requests are now subjected to CSRF verification. Consult :doc:" "`the Django CSRF documentation ` for details on how to handle " "CSRF verification in AJAX requests." msgstr "" "在 Django 1.2.5 之前,Django 的 CSRF 预防系统豁免了 AJAX 请求的 CSRF 验证;然" "而,由于我们收到的有关 `安全问题`_ 的报告,现在 *所有* 请求都需要进行 CSRF 验" "证。请参考 :doc:`Django CSRF 文档 ` 以获取有关如何处理 AJAX 请求中" "的 CSRF 验证的详细信息。" msgid "" "Prior to Django 1.2.5, the Django administrative interface allowed filtering " "on any model field or relation -- not just those specified in " "``list_filter`` -- via query string manipulation. Due to security issues " "reported to us, however, query string lookup arguments in the admin must be " "for fields or relations specified in ``list_filter`` or ``date_hierarchy``." msgstr "" "在 Django 1.2.5 之前,Django 管理界面允许通过查询字符串操作对任何模型字段或关" "系进行过滤,而不仅仅是那些在 ``list_filter`` 中指定的字段。然而,由于我们收到" "的有关安全问题的报告,现在在管理界面中的查询字符串查找参数必须是在 " "``list_filter`` 或 ``date_hierarchy`` 中指定的字段或关系。" msgid "Deleting a model doesn't delete associated files" msgstr "删除模型不会删除关联的文件" msgid "" "In earlier Django versions, when a model instance containing a :class:" "`~django.db.models.FileField` was deleted, :class:`~django.db.models." "FileField` took it upon itself to also delete the file from the backend " "storage. This opened the door to several data-loss scenarios, including " "rolled-back transactions and fields on different models referencing the same " "file. In Django 1.3, when a model is deleted the :class:`~django.db.models." "FileField`’s ``delete()`` method won't be called. If you need cleanup of " "orphaned files, you'll need to handle it yourself (for instance, with a " "custom management command that can be run manually or scheduled to run " "periodically via e.g. cron)." msgstr "" "在早期的 Django 版本中,当删除包含 :class:`~django.db.models.FileField` 的模" "型实例时,:class:`~django.db.models.FileField` 会自行从后端存储中删除文件。这" "打开了许多数据丢失的可能性,包括已回滚的事务以及不同模型上的字段引用相同的文" "件。在 Django 1.3 中,当删除模型时,不会调用 :class:`~django.db.models." "FileField` 的 ``delete()`` 方法。如果需要清理孤立的文件,您需要自行处理它(例" "如,使用自定义管理命令,可以手动运行或通过 cron 等定期运行)。" msgid "PasswordInput default rendering behavior" msgstr "PasswordInput 默认渲染行为" msgid "" "The :class:`~django.forms.PasswordInput` form widget, intended for use with " "form fields which represent passwords, accepts a boolean keyword argument " "``render_value`` indicating whether to send its data back to the browser " "when displaying a submitted form with errors. Prior to Django 1.3, this " "argument defaulted to ``True``, meaning that the submitted password would be " "sent back to the browser as part of the form. Developers who wished to add a " "bit of additional security by excluding that value from the redisplayed form " "could instantiate a :class:`~django.forms.PasswordInput` passing " "``render_value=False`` ." msgstr "" ":class:`~django.forms.PasswordInput` 表单小部件,用于表示密码的表单字段,接受" "一个布尔关键字参数 ``render_value``,指示在显示带有错误的提交表单时是否将其数" "据发送回浏览器。在 Django 1.3 之前,这个参数的默认值是 ``True``,这意味着提交" "的密码将作为表单的一部分发送回浏览器。希望通过将该值从重新显示的表单中排除以" "增加一些额外安全性的开发人员可以实例化一个 :class:`~django.forms." "PasswordInput` 并传递 ``render_value=False``。" msgid "" "Due to the sensitive nature of passwords, however, Django 1.3 takes this " "step automatically; the default value of ``render_value`` is now ``False``, " "and developers who want the password value returned to the browser on a " "submission with errors (the previous behavior) must now explicitly indicate " "this. For example::" msgstr "" "然而,由于密码的敏感性质,Django 1.3 现在会自动采取这一步骤;" "``render_value`` 的默认值现在为 ``False``,希望在出现错误的情况下将密码值返回" "到浏览器的开发人员(以前的行为)现在必须明确指出这一点。例如:" msgid "Clearable default widget for FileField" msgstr "FileField 的可清除默认小部件" msgid "" "Django 1.3 now includes a :class:`~django.forms.ClearableFileInput` form " "widget in addition to :class:`~django.forms.FileInput`. " "``ClearableFileInput`` renders with a checkbox to clear the field's value " "(if the field has a value and is not required); ``FileInput`` provided no " "means for clearing an existing file from a ``FileField``." msgstr "" "Django 1.3 现在除了 :class:`~django.forms.FileInput` 外还包括一个 :class:" "`~django.forms.ClearableFileInput` 表单小部件。``ClearableFileInput`` 渲染时" "包含一个清除字段值的复选框(如果字段有值且不是必需的);而 ``FileInput`` 无法" "清除 ``FileField`` 中的现有文件。" msgid "" "``ClearableFileInput`` is now the default widget for a ``FileField``, so " "existing forms including ``FileField`` without assigning a custom widget " "will need to account for the possible extra checkbox in the rendered form " "output." msgstr "" "``ClearableFileInput`` 现在是 ``FileField`` 的默认小部件,因此包含 " "``FileField`` 的现有表单如果没有分配自定义小部件,需要考虑在渲染的表单输出中" "可能会出现额外的复选框。" msgid "" "To return to the previous rendering (without the ability to clear the " "``FileField``), use the ``FileInput`` widget in place of " "``ClearableFileInput``. For instance, in a ``ModelForm`` for a hypothetical " "``Document`` model with a ``FileField`` named ``document``::" msgstr "" "要返回到以前的渲染方式(不具备清除 ``FileField`` 的能力),可以在 " "``ClearableFileInput`` 的位置使用 ``FileInput`` 小部件。例如,在假设有一个名" "为 ``document`` 的 ``FileField`` 的假设 ``Document`` 模型的 ``ModelForm`` " "中:" msgid "New index on database session table" msgstr "数据库会话表上的新索引" msgid "" "Prior to Django 1.3, the database table used by the database backend for " "the :doc:`sessions ` app had no index on the " "``expire_date`` column. As a result, date-based queries on the session table " "-- such as the query that is needed to purge old sessions -- would be very " "slow if there were lots of sessions." msgstr "" "在 Django 1.3 之前,数据库后端用于 :doc:`sessions ` 应" "用的数据库表上没有对 ``expire_date`` 列创建索引。因此,如果有大量会话,对会话" "表的日期查询(例如清除旧会话所需的查询)会非常慢。" msgid "" "If you have an existing project that is using the database session backend, " "you don't have to do anything to accommodate this change. However, you may " "get a significant performance boost if you manually add the new index to the " "session table. The SQL that will add the index can be found by running the " "``sqlindexes`` admin command:" msgstr "" "如果您有一个已经在使用数据库会话后端的现有项目,您无需采取任何措施来适应此更" "改。但是,如果您手动将新索引添加到会话表中,可能会显著提高性能。可以通过运行 " "``sqlindexes`` 管理命令来找到添加索引的 SQL:" msgid "No more naughty words" msgstr "不再有不雅词汇" msgid "" "Django has historically provided (and enforced) a list of profanities. The " "comments app has enforced this list of profanities, preventing people from " "submitting comments that contained one of those profanities." msgstr "" "Django 历史上提供了(并执行了)一份不雅词汇列表。评论应用程序已经执行了这个不" "雅词汇列表,防止人们提交包含这些不雅词汇之一的评论。" msgid "" "Unfortunately, the technique used to implement this profanities list was " "woefully naive, and prone to the `Scunthorpe problem`_. Improving the built-" "in filter to fix this problem would require significant effort, and since " "natural language processing isn't the normal domain of a web framework, we " "have \"fixed\" the problem by making the list of prohibited words an empty " "list." msgstr "" "不幸的是,用于实现这个粗话列表的技术非常天真,并容易受到 `斯肯索普问题`_ 的影" "响。要改进内置的过滤器以解决这个问题需要很大的努力,而且由于自然语言处理不是" "一个 Web 框架的正常领域,我们通过将禁止使用的单词列表设置为空来“解决”了这个问" "题。" msgid "" "If you want to restore the old behavior, simply put a ``PROFANITIES_LIST`` " "setting in your settings file that includes the words that you want to " "prohibit (see the :commit:`commit that implemented this change " "` if you want to see the list of " "words that was historically prohibited). However, if avoiding profanities is " "important to you, you would be well advised to seek out a better, less naive " "approach to the problem." msgstr "" "如果您想恢复旧的行为,只需在您的设置文件中设置一个包含您要禁止的单词的 " "``PROFANITIES_LIST`` 设置(如果您想查看历史上被禁止的单词列表,请参考 :" "commit:`实施这个更改的提交 `)。然" "而,如果避免粗话对您很重要,建议您寻找一个更好、不那么天真的解决方法来解决这" "个问题。" msgid "Localflavor changes" msgstr "Localflavor 更改" msgid "" "Django 1.3 introduces the following backwards-incompatible changes to local " "flavors:" msgstr "Django 1.3 引入了以下对本地风格的向后不兼容的更改:" msgid "" "Canada (ca) -- The province \"Newfoundland and Labrador\" has had its " "province code updated to \"NL\", rather than the older \"NF\". In addition, " "the Yukon Territory has had its province code corrected to \"YT\", instead " "of \"YK\"." msgstr "" "加拿大(ca)- 省份“纽芬兰与拉布拉多”已将其省份代码更新为“NL”,而不是较旧" "的“NF”。此外,育空地区的省份代码已更正为“YT”,而不是“YK”。" msgid "" "Indonesia (id) -- The province \"Nanggroe Aceh Darussalam (NAD)\" has been " "removed from the province list in favor of the new official designation " "\"Aceh (ACE)\"." msgstr "" "印度尼西亚(id)- 省份“ Nanggroe Aceh Darussalam (NAD)”已从省份列表中移除,转" "而使用新的官方名称“ Aceh (ACE)”。" msgid "" "United States of America (us) -- The list of \"states\" used by " "``USStateField`` has expanded to include Armed Forces postal codes. This is " "backwards-incompatible if you were relying on ``USStateField`` not including " "them." msgstr "" "美利坚合众国(us)-- 由 ``USStateField`` 使用的“州”列表已扩展,包括了武装部队" "的邮政编码。如果您依赖于 ``USStateField`` 不包括它们,这将是不兼容的。" msgid "FormSet updates" msgstr "FormSet 更新" msgid "" "In Django 1.3 ``FormSet`` creation behavior is modified slightly. " "Historically the class didn't make a distinction between not being passed " "data and being passed empty dictionary. This was inconsistent with behavior " "in other parts of the framework. Starting with 1.3 if you pass in empty " "dictionary the ``FormSet`` will raise a ``ValidationError``." msgstr "" "在 Django 1.3 中,``FormSet`` 的创建行为略有修改。在历史上,该类没有区分未传" "递数据和传递空字典之间的区别。这与框架的其他部分的行为不一致。从1.3版本开始," "如果传递空字典,``FormSet`` 将引发 ``ValidationError``。" msgid "For example with a ``FormSet``:" msgstr "例如,使用一个 ``FormSet``:" msgid "the following code will raise a ``ValidationError``:" msgstr "以下代码将引发 ``ValidationError``:" msgid "" "if you need to instantiate an empty ``FormSet``, don't pass in the data or " "use ``None``:" msgstr "如果需要实例化一个空的 ``FormSet``,不要传递数据或使用 ``None``:" msgid "Callables in templates" msgstr "模板中的可调用对象" msgid "" "Previously, a callable in a template would only be called automatically as " "part of the variable resolution process if it was retrieved via attribute " "lookup. This was an inconsistency that could result in confusing and " "unhelpful behavior:" msgstr "" "以前,在模板中的可调用对象只有在通过属性查找检索时才会作为变量解析过程的一部" "分自动调用。这是一个不一致的地方,可能导致令人困惑和无益的行为:" msgid "" "This has been resolved in Django 1.3 - the result in both cases will be " "``u'Joe Bloggs'``. Although the previous behavior was not useful for a " "template language designed for web designers, and was never deliberately " "supported, it is possible that some templates may be broken by this change." msgstr "" "这在 Django 1.3 中已经解决了 - 在这两种情况下的结果都将是 ``u'Joe Bloggs'``。" "尽管先前的行为对于为网页设计师设计的模板语言来说并不实用,也从未有意支持,但" "有可能一些模板可能会因此更改而中断。" msgid "Changed priority of translation loading" msgstr "改变了翻译加载的优先级" msgid "" "Work has been done to simplify, rationalize and properly document the " "algorithm used by Django at runtime to build translations from the different " "translations found on disk, namely:" msgstr "" "已经进行了工作,以简化、合理化并正确记录 Django 在运行时用于从磁盘上找到的不" "同翻译中构建翻译的算法,即:" msgid "" "For translatable literals found in Python code and templates (``'django'`` " "gettext domain):" msgstr "" "对于在 Python 代码和模板中找到的可翻译字面值(``'django'`` gettext 域):" msgid "" "Priorities of translations included with applications listed in the :setting:" "`INSTALLED_APPS` setting were changed. To provide a behavior consistent with " "other parts of Django that also use such setting (templates, etc.) now, when " "building the translation that will be made available, the apps listed first " "have higher precedence than the ones listed later." msgstr "" "在 :setting:`INSTALLED_APPS` 设置中列出的应用程序包含的翻译的优先级发生了变" "化。为了与 Django 的其他部分(例如模板等)使用的类似设置行为保持一致,现在在" "构建将要提供的翻译时,首先列出的应用程序比后面列出的应用程序具有更高的优先" "级。" msgid "" "Now it is possible to override the translations shipped with applications by " "using the :setting:`LOCALE_PATHS` setting whose translations have now higher " "precedence than the translations of :setting:`INSTALLED_APPS` applications. " "The relative priority among the values listed in this setting has also been " "modified so the paths listed first have higher precedence than the ones " "listed later." msgstr "" "现在可以使用 :setting:`LOCALE_PATHS` 设置来覆盖应用程序中附带的翻译,这些翻译" "的优先级高于 :setting:`INSTALLED_APPS` 应用程序的翻译。此设置中列出的值之间的" "相对优先级也已经修改,因此首先列出的路径比后面列出的路径具有更高的优先级。" msgid "" "The ``locale`` subdirectory of the directory containing the settings, that " "usually coincides with and is known as the *project directory* is being " "deprecated in this release as a source of translations. (the precedence of " "these translations is intermediate between applications and :setting:" "`LOCALE_PATHS` translations). See the `corresponding deprecated features " "section`_ of this document." msgstr "" "在这个版本中,包含设置的目录的 ``locale`` 子目录,通常与项目目录重合并被称为 " "*项目目录*,被弃用为翻译的来源。(这些翻译的优先级介于应用程序和 :setting:" "`LOCALE_PATHS` 翻译之间)。请参阅本文档的 `相应弃用功能部分`_。" msgid "" "For translatable literals found in JavaScript code (``'djangojs'`` gettext " "domain):" msgstr "" "对于在 JavaScript 代码中找到的可翻译字面值(``'djangojs'`` gettext 域):" msgid "" "Similarly to the ``'django'`` domain translations: Overriding of " "translations shipped with applications by using the :setting:`LOCALE_PATHS` " "setting is now possible for this domain too. These translations have higher " "precedence than the translations of Python packages passed to the " "``javascript_catalog()`` view. Paths listed first have higher precedence " "than the ones listed later." msgstr "" "与 ``'django'`` 域的翻译类似:现在也可以使用 :setting:`LOCALE_PATHS` 设置来覆" "盖应用程序中附带的 JavaScript 代码的翻译。这些翻译的优先级高于传递给 " "``javascript_catalog()`` 视图的 Python 包的翻译。首先列出的路径比后面列出的路" "径具有更高的优先级。" msgid "" "Translations under the ``locale`` subdirectory of the *project directory* " "have never been taken in account for JavaScript translations and remain in " "the same situation considering the deprecation of such location." msgstr "" "位于 *项目目录* 的 ``locale`` 子目录下的 JavaScript 翻译从未被考虑过,考虑到" "这个位置的弃用,它们将保持不变。" msgid "Transaction management" msgstr "事务管理" msgid "" "When using managed transactions -- that is, anything but the default " "autocommit mode -- it is important when a transaction is marked as " "\"dirty\". Dirty transactions are committed by the ``commit_on_success`` " "decorator or the ``django.middleware.transaction.TransactionMiddleware``, " "and ``commit_manually`` forces them to be closed explicitly; clean " "transactions \"get a pass\", which means they are usually rolled back at the " "end of a request when the connection is closed." msgstr "" "在使用托管事务时 -- 也就是说,除了默认的自动提交模式之外的任何情况 -- 当一个" "事务被标记为“脏”时非常重要。脏事务将由 ``commit_on_success`` 装饰器或 " "``django.middleware.transaction.TransactionMiddleware`` 提交,并且 " "``commit_manually`` 强制将它们明确关闭;干净的事务“得到允许”,这意味着它们通" "常在请求结束时在连接关闭时回滚。" msgid "" "Until Django 1.3, transactions were only marked dirty when Django was aware " "of a modifying operation performed in them; that is, either some model was " "saved, some bulk update or delete was performed, or the user explicitly " "called ``transaction.set_dirty()``. In Django 1.3, a transaction is marked " "dirty when *any* database operation is performed." msgstr "" "在 Django 1.3 之前,只有在 Django 察觉到在事务中执行了修改操作时,事务才会被" "标记为脏事务;也就是说,要么保存了某个模型,要么执行了某个批量更新或删除操" "作,要么用户显式调用了 ``transaction.set_dirty()``。在 Django 1.3 中,只要执" "行了 *任何* 数据库操作,事务就会被标记为脏事务。" msgid "" "As a result of this change, you no longer need to set a transaction dirty " "explicitly when you execute raw SQL or use a data-modifying ``SELECT``. " "However, you *do* need to explicitly close any read-only transactions that " "are being managed using ``commit_manually()``. For example::" msgstr "" "由于这个改变,当执行原始 SQL 或使用修改数据的 ``SELECT`` 时,您不再需要显式设" "置事务为脏事务。然而,您需要显式关闭任何使用 ``commit_manually()`` 管理的只读" "事务。例如:" msgid "" "Prior to Django 1.3, this would work without error. However, under Django " "1.3, this will raise a :class:`~django.db.transaction." "TransactionManagementError` because the read operation that retrieves the " "``MyObject`` instance leaves the transaction in a dirty state." msgstr "" "在 Django 1.3 之前,这将不会出错。然而,在 Django 1.3 下,这将引发一个 :" "class:`~django.db.transaction.TransactionManagementError`,因为检索 " "``MyObject`` 实例的读操作将事务留在了脏状态。" msgid "No password reset for inactive users" msgstr "不允许非活跃用户重置密码" msgid "" "Prior to Django 1.3, inactive users were able to request a password reset " "email and reset their password. In Django 1.3 inactive users will receive " "the same message as a nonexistent account." msgstr "" "在 Django 1.3 之前,非活跃用户可以请求发送密码重置邮件并重置密码。而在 " "Django 1.3 中,非活跃用户将收到与不存在的帐户相同的消息。" msgid "Password reset view now accepts ``from_email``" msgstr "密码重置视图现在接受 ``from_email`` 参数。" msgid "" "The ``django.contrib.auth.views.password_reset()`` view now accepts a " "``from_email`` parameter, which is passed to the ``password_reset_form``’s " "``save()`` method as a keyword argument. If you are using this view with a " "custom password reset form, then you will need to ensure your form's " "``save()`` method accepts this keyword argument." msgstr "" "``django.contrib.auth.views.password_reset()`` 视图现在接受一个 " "``from_email`` 参数,该参数将作为关键字参数传递给 ``password_reset_form`` 的 " "``save()`` 方法。如果您正在使用自定义密码重置表单与此视图,则需要确保您表单" "的 ``save()`` 方法接受这个关键字参数。" msgid "Features deprecated in 1.3" msgstr "在 1.3 中被废弃的功能" msgid "" "Django 1.3 deprecates some features from earlier releases. These features " "are still supported, but will be gradually phased out over the next few " "release cycles." msgstr "" "Django 1.3 弃用了一些早期版本的功能。这些功能仍然受支持,但将在接下来的几个发" "布周期内逐步淘汰。" msgid "" "Code taking advantage of any of the features below will raise a " "``PendingDeprecationWarning`` in Django 1.3. This warning will be silent by " "default, but may be turned on using Python's :mod:`warnings` module, or by " "running Python with a ``-Wd`` or ``-Wall`` flag." msgstr "" "使用以下任何特性的代码将在 Django 1.3 中引发 ``PendingDeprecationWarning``。" "默认情况下,此警告是静默的,但可以使用 Python 的 :mod:`warnings` 模块打开,或" "者通过在运行 Python 时使用 ``-Wd`` 或 ``-Wall`` 标志来打开。" msgid "" "In Django 1.4, these warnings will become a ``DeprecationWarning``, which is " "*not* silent. In Django 1.5 support for these features will be removed " "entirely." msgstr "" "在 Django 1.4 中,这些警告将变成 ``DeprecationWarning``,它是 *不* 静默的。" "在 Django 1.5 中,将完全删除对这些特性的支持。" msgid "" "For more details, see the documentation :doc:`Django's release process ` and our :doc:`deprecation timeline `." msgstr "" "有关更多详细信息,请参阅文档 :doc:`Django 的发布流程 ` 和我们的 :doc:`弃用时间表 `。" msgid "``mod_python`` support" msgstr "``mod_python`` 支持" msgid "" "The ``mod_python`` library has not had a release since 2007 or a commit " "since 2008. The Apache Foundation board voted to remove ``mod_python`` from " "the set of active projects in its version control repositories, and its lead " "developer has shifted all of his efforts toward the lighter, slimmer, more " "stable, and more flexible ``mod_wsgi`` backend." msgstr "" "``mod_python`` 库自 2007 年以来没有发布过新版本,自 2008 年以来也没有提交。" "Apache 基金会董事会投票决定将 ``mod_python`` 从其版本控制存储库的活动项目集中" "删除,其主要开发人员已将所有工作重心转向了更轻巧、更稳定、更灵活的 " "``mod_wsgi`` 后端。" msgid "" "If you are currently using the ``mod_python`` request handler, you should " "redeploy your Django projects using another request handler. :doc:`mod_wsgi " "` is the request handler recommended by the " "Django project, but FastCGI is also supported. Support for ``mod_python`` " "deployment will be removed in Django 1.5." msgstr "" "如果您当前使用的是 ``mod_python`` 请求处理程序,您应该重新部署您的 Django 项" "目,使用其他请求处理程序。Django 项目推荐使用的请求处理程序是 :doc:`mod_wsgi " "`,但也支持 FastCGI。对于 ``mod_python`` 部署" "的支持将在 Django 1.5 中被移除。" msgid "Function-based generic views" msgstr "基于函数的通用视图" msgid "" "As a result of the introduction of class-based generic views, the function-" "based generic views provided by Django have been deprecated. The following " "modules and the views they contain have been deprecated:" msgstr "" "由于引入了基于类的通用视图,Django 提供的基于函数的通用视图已被弃用。以下模块" "及其包含的视图已被弃用:" msgid "``django.views.generic.create_update``" msgstr "``django.views.generic.create_update``" msgid "``django.views.generic.date_based``" msgstr "``django.views.generic.date_based``" msgid "``django.views.generic.list_detail``" msgstr "``django.views.generic.list_detail``" msgid "``django.views.generic.simple``" msgstr "``django.views.generic.simple``" msgid "Test client response ``template`` attribute" msgstr "测试客户端响应的 ``template`` 属性" msgid "" "Django's :ref:`test client ` returns :class:`~django.test." "Response` objects annotated with extra testing information. In Django " "versions prior to 1.3, this included a ``template`` attribute containing " "information about templates rendered in generating the response: either " "None, a single :class:`~django.template.Template` object, or a list of :" "class:`~django.template.Template` objects. This inconsistency in return " "values (sometimes a list, sometimes not) made the attribute difficult to " "work with." msgstr "" "Django 的 :ref:`测试客户端 ` 返回带有额外测试信息的 :class:" "`~django.test.Response` 对象。在 Django 1.3 之前的版本中,这包括一个 " "``template`` 属性,其中包含有关在生成响应时渲染的模板的信息:可以是 None、一" "个 :class:`~django.template.Template` 对象,或一个 :class:`~django.template." "Template` 对象的列表。返回值的这种不一致性(有时是列表,有时不是)使得这个属" "性难以使用。" msgid "" "In Django 1.3 the ``template`` attribute is deprecated in favor of a new :" "attr:`~django.test.Response.templates` attribute, which is always a list, " "even if it has only a single element or no elements." msgstr "" "在 Django 1.3 中,``template`` 属性已被弃用,改为使用新的 :attr:`~django." "test.Response.templates` 属性,该属性始终是一个列表,即使它只有一个元素或没有" "元素。" msgid "``DjangoTestRunner``" msgstr "``DjangoTestRunner``" msgid "" "As a result of the introduction of support for ``unittest2``, the features " "of ``django.test.simple.DjangoTestRunner`` (including fail-fast and Ctrl-C " "test termination) have been made redundant. In view of this redundancy, " "``DjangoTestRunner`` has been turned into an empty placeholder class, and " "will be removed entirely in Django 1.5." msgstr "" "由于引入了对 ``unittest2`` 的支持,``django.test.simple.DjangoTestRunner`` 的" "特性(包括快速失败和 Ctrl-C 测试终止)已经变得多余。考虑到这种多余性," "``DjangoTestRunner`` 已经被转变成一个空的占位符类,并将在 Django 1.5 中完全删" "除。" msgid "Changes to ``url`` and ``ssi``" msgstr "关于 ``url`` 和 ``ssi`` 的更改" msgid "" "Most template tags will allow you to pass in either constants or variables " "as arguments -- for example:" msgstr "大多数模板标签允许您将常量或变量作为参数传递,例如:" msgid "" "allows you to specify a base template as a constant, but if you have a " "context variable ``templ`` that contains the value ``base.html``:" msgstr "" "允许您将一个基本模板指定为常量,但如果您有一个包含值 ``base.html`` 的上下文变" "量 ``templ``:" msgid "is also legal." msgstr "这也是合法的。" msgid "" "However, due to an accident of history, the ``url`` and ``ssi`` are " "different. These tags use the second, quoteless syntax, but interpret the " "argument as a constant. This means it isn't possible to use a context " "variable as the target of a ``url`` and ``ssi`` tag." msgstr "" "然而,由于历史原因,``url`` 和 ``ssi`` 是不同的。这些标签使用第二种无引号的语" "法,但将参数解释为常量。这意味着无法使用上下文变量作为 ``url`` 和 ``ssi`` 标" "签的目标。" msgid "" "Django 1.3 marks the start of the process to correct this historical " "accident. Django 1.3 adds a new template library -- ``future`` -- that " "provides alternate implementations of the ``url`` and ``ssi`` template tags. " "This ``future`` library implement behavior that makes the handling of the " "first argument consistent with the handling of all other variables. So, an " "existing template that contains:" msgstr "" "Django 1.3 标志着纠正这个历史意外的过程的开始。Django 1.3 添加了一个新的模板" "库 -- ``future``,提供了 ``url`` 和 ``ssi`` 模板标签的替代实现。这个 " "``future`` 库实现了使第一个参数的处理与所有其他变量的处理一致的行为。因此,一" "个包含以下内容的现有模板:" msgid "should be replaced with:" msgstr "应该替换为:" msgid "" "The tags implementing the old behavior have been deprecated, and in Django " "1.5, the old behavior will be replaced with the new behavior. To ensure " "compatibility with future versions of Django, existing templates should be " "modified to use the new ``future`` libraries and syntax." msgstr "" "实现旧行为的标签已经被弃用,在 Django 1.5 中,旧行为将被新行为替代。为了确保" "与未来版本的 Django 兼容,现有模板应该被修改以使用新的 ``future`` 库和语法。" msgid "Changes to the login methods of the admin" msgstr "管理员登录方法的更改" msgid "" "In previous version the admin app defined login methods in multiple " "locations and ignored the almost identical implementation in the already " "used auth app. A side effect of this duplication was the missing adoption of " "the changes made in :commit:`r12634 " "` to support a broader set of " "characters for usernames." msgstr "" "在之前的版本中,管理应用在多个位置定义了登录方法,并忽略了已经使用的 auth 应" "用中几乎相同的实现。这种重复的副作用是没有采用 :commit:`r12634 " "` 中所做的更改,以支持更广泛的用户" "名字符集。" msgid "" "This release refactors the admin's login mechanism to use a subclass of the :" "class:`~django.contrib.auth.forms.AuthenticationForm` instead of a manual " "form validation. The previously undocumented method ``'django.contrib.admin." "sites.AdminSite.display_login_form'`` has been removed in favor of a new :" "attr:`~django.contrib.admin.AdminSite.login_form` attribute." msgstr "" "这个版本重构了管理界面的登录机制,使用了 :class:`~django.contrib.auth.forms." "AuthenticationForm` 的子类来代替手动表单验证。以前未记录的方法 ``'django." "contrib.admin.sites.AdminSite.display_login_form'`` 已被移除,改为使用新的 :" "attr:`~django.contrib.admin.AdminSite.login_form` 属性。" msgid "``reset`` and ``sqlreset`` management commands" msgstr "``reset`` 和 ``sqlreset`` 管理命令" msgid "" "Those commands have been deprecated. The ``flush`` and ``sqlflush`` commands " "can be used to delete everything. You can also use ALTER TABLE or DROP TABLE " "statements manually." msgstr "" "这些命令已经被弃用。可以使用 ``flush`` 和 ``sqlflush`` 命令来删除所有内容。您" "也可以手动使用 ALTER TABLE 或 DROP TABLE 语句。" msgid "" "The function-based :setting:`TEST_RUNNER` previously used to execute the " "GeoDjango test suite, ``django.contrib.gis.tests.run_gis_tests``, was " "deprecated for the class-based runner, ``django.contrib.gis.tests." "GeoDjangoTestSuiteRunner``." msgstr "" "用于执行 GeoDjango 测试套件的函数式 :setting:`TEST_RUNNER`,以前称为 " "``django.contrib.gis.tests.run_gis_tests``,已被弃用,取而代之的是基于类的运" "行器,``django.contrib.gis.tests.GeoDjangoTestSuiteRunner``。" msgid "" "Previously, calling :meth:`~django.contrib.gis.geos.GEOSGeometry.transform` " "would silently do nothing when GDAL wasn't available. Now, a :class:" "`~django.contrib.gis.geos.GEOSException` is properly raised to indicate " "possible faulty application code. A warning is now raised if :meth:`~django." "contrib.gis.geos.GEOSGeometry.transform` is called when the SRID of the " "geometry is less than 0 or ``None``." msgstr "" "以前,调用 :meth:`~django.contrib.gis.geos.GEOSGeometry.transform` 在没有安" "装 GDAL 时会默默地什么也不做。现在,会引发一个 :class:`~django.contrib.gis." "geos.GEOSException` 来指示可能存在问题的应用程序代码。如果在几何对象的 SRID " "小于 0 或为 ``None`` 时调用 :meth:`~django.contrib.gis.geos.GEOSGeometry." "transform`,则会引发警告。" msgid "``CZBirthNumberField.clean``" msgstr "``CZBirthNumberField.clean``" msgid "" "Previously this field's ``clean()`` method accepted a second, gender, " "argument which allowed stronger validation checks to be made, however since " "this argument could never actually be passed from the Django form machinery " "it is now pending deprecation." msgstr "" "以前,这个字段的 ``clean()`` 方法接受第二个参数 gender,允许进行更强的验证检" "查,但由于这个参数实际上无法从 Django 表单机制中传递,因此它现在处于待弃用状" "态。" msgid "``CompatCookie``" msgstr "``CompatCookie``" msgid "" "Previously, ``django.http`` exposed an undocumented ``CompatCookie`` class, " "which was a bugfix wrapper around the standard library ``SimpleCookie``. As " "the fixes are moving upstream, this is now deprecated - you should use " "``from django.http import SimpleCookie`` instead." msgstr "" "以前,``django.http`` 暴露了一个未记录的 ``CompatCookie`` 类,它是标准库 " "``SimpleCookie`` 的一个修复包装。由于修复已经被合并到标准库中,这个类现在已被" "弃用 - 您应该使用 ``from django.http import SimpleCookie``。" msgid "Loading of *project-level* translations" msgstr "加载 *项目级别* 的翻译" msgid "" "This release of Django starts the deprecation process for inclusion of " "translations located under the so-called *project path* in the translation " "building process performed at runtime. The :setting:`LOCALE_PATHS` setting " "can be used for the same task by adding the filesystem path to a ``locale`` " "directory containing project-level translations to the value of that setting." msgstr "" "Django 的这个版本开始了对在运行时进行的翻译构建过程中包含位于所谓的 *项目路径" "* 下的翻译的弃用过程。可以使用 :setting:`LOCALE_PATHS` 设置来执行相同的任务," "只需将包含项目级别翻译的 ``locale`` 目录的文件系统路径添加到该设置的值中。" msgid "Rationale for this decision:" msgstr "这个决定的理由:" msgid "" "The *project path* has always been a loosely defined concept (actually, the " "directory used for locating project-level translations is the directory " "containing the settings module) and there has been a shift in other parts of " "the framework to stop using it as a reference for location of assets at " "runtime." msgstr "" "*项目路径* 一直是一个宽泛定义的概念(实际上,用于定位项目级别翻译的目录是包含" "设置模块的目录),在框架的其他部分也已经有了不再将其作为运行时资源位置的参考" "的变化。" msgid "" "Detection of the ``locale`` subdirectory tends to fail when the deployment " "scenario is more complex than the basic one. e.g. it fails when the settings " "module is a directory (ticket #10765)." msgstr "" "当部署场景比基本情况更复杂时,检测 ``locale`` 子目录的功能往往会失败,例如," "当设置模块是一个目录时(ticket #10765)。" msgid "" "There are potential strange development- and deployment-time problems like " "the fact that the ``project_dir/locale/`` subdir can generate spurious error " "messages when the project directory is added to the Python path (``manage.py " "runserver`` does this) and then it clashes with the equally named standard " "library module, this is a typical warning message:" msgstr "" "存在一些潜在的奇怪的开发和部署时的问题,比如在将项目目录添加到 Python 路径时" "(``manage.py runserver`` 会这样做),``project_dir/locale/`` 子目录可能会生" "成虚假的错误消息,并且会与同名的标准库模块发生冲突,这是一个典型的警告消息:" msgid "" "This location wasn't included in the translation building process for " "JavaScript literals. This deprecation removes such inconsistency." msgstr "" "此位置未包含在 JavaScript 字面量的翻译构建过程中。这种弃用消除了此类不一致" "性。" msgid "``PermWrapper`` moved to ``django.contrib.auth.context_processors``" msgstr "``PermWrapper`` 已移动到 ``django.contrib.auth.context_processors``" msgid "" "In Django 1.2, we began the process of changing the location of the ``auth`` " "context processor from ``django.core.context_processors`` to ``django." "contrib.auth.context_processors``. However, the ``PermWrapper`` support " "class was mistakenly omitted from that migration. In Django 1.3, the " "``PermWrapper`` class has also been moved to ``django.contrib.auth." "context_processors``, along with the ``PermLookupDict`` support class. The " "new classes are functionally identical to their old versions; only the " "module location has changed." msgstr "" "在 Django 1.2 中,我们开始了将 ``auth`` 上下文处理器的位置从 ``django.core." "context_processors`` 更改为 ``django.contrib.auth.context_processors`` 的过" "程。然而,``PermWrapper`` 支持类被错误地遗漏在迁移中。在 Django 1.3 中," "``PermWrapper`` 类也已经移动到 ``django.contrib.auth.context_processors``," "与 ``PermLookupDict`` 支持类一起。新的类在功能上与旧版本完全相同;只是模块位" "置发生了变化。" msgid "Removal of ``XMLField``" msgstr "移除了 ``XMLField``" msgid "" "When Django was first released, Django included an ``XMLField`` that " "performed automatic XML validation for any field input. However, this " "validation function hasn't been performed since the introduction of " "``newforms``, prior to the 1.0 release. As a result, ``XMLField`` as " "currently implemented is functionally indistinguishable from a simple :class:" "`~django.db.models.TextField`." msgstr "" "当 Django 首次发布时,Django 包括了一个 ``XMLField``,用于对任何字段输入执行" "自动 XML 验证。然而,自从引入了 ``newforms`` (在 1.0 版本发布之前)以来,这" "种验证功能就不再执行。因此,当前实现的 ``XMLField`` 在功能上与一个简单的 :" "class:`~django.db.models.TextField` 没有区别。" msgid "" "For this reason, Django 1.3 has fast-tracked the deprecation of ``XMLField`` " "-- instead of a two-release deprecation, ``XMLField`` will be removed " "entirely in Django 1.4." msgstr "" "因此,Django 1.3 已经加速了对 ``XMLField`` 的弃用 -- 不再需要两个版本的弃用," "``XMLField`` 将在 Django 1.4 中被完全删除。" msgid "" "It's easy to update your code to accommodate this change -- just replace all " "uses of ``XMLField`` with ``TextField``, and remove the ``schema_path`` " "keyword argument (if it is specified)." msgstr "" "更新您的代码以适应这个更改非常简单 -- 只需将所有使用的 ``XMLField`` 替换为 " "``TextField``,并删除 ``schema_path`` 关键字参数(如果已指定)。" msgid "Django 1.3.1 release notes" msgstr "Django 1.3.1 版本发行说明" msgid "Welcome to Django 1.3.1!" msgstr "欢迎来到 Django 1.3.1 版本!" msgid "" "This is the first security release in the Django 1.3 series, fixing several " "security issues in Django 1.3. Django 1.3.1 is a recommended upgrade for " "all users of Django 1.3." msgstr "" "这是 Django 1.3 系列中的第一个安全版本,修复了 Django 1.3 中的几个安全问题。" "强烈建议所有使用 Django 1.3 的用户升级到 Django 1.3.1 。" msgid "Django 1.3.2 release notes" msgstr "Django 1.3.2 版本发行说明" msgid "*July 30, 2012*" msgstr "*2012 年 7 月 30 日*" msgid "" "This is the second security release in the Django 1.3 series, fixing several " "security issues in Django 1.3. Django 1.3.2 is a recommended upgrade for all " "users of Django 1.3." msgstr "" "这是 Django 1.3 系列中的第二个安全版本,修复了 Django 1.3 中的几个安全问题。" "强烈建议所有使用 Django 1.3 的用户升级到 Django 1.3.2 。" msgid "Django 1.3.3 release notes" msgstr "Django 1.3.3 版本发行说明" msgid "*August 1, 2012*" msgstr "*2012 年 8 月 1 日*" msgid "" "Following Monday's security release of :doc:`Django 1.3.2 `, we began receiving reports that one of the fixes applied " "was breaking Python 2.4 compatibility for Django 1.3. Since Python 2.4 is a " "supported Python version for that release series, this release fixes " "compatibility with Python 2.4." msgstr "" "在周一发布了 :doc:`Django 1.3.2 ` 的安全更新后,我们开始收到" "报告称其中一个应用的修复措施破坏了 Django 1.3 的 Python 2.4 兼容性。由于 " "Python 2.4 是该版本系列的支持 Python 版本,因此这个发布修复了与 Python 2.4 的" "兼容性。" msgid "Django 1.3.4 release notes" msgstr "Django 1.3.4 版本发行说明" msgid "*October 17, 2012*" msgstr "*2012 年 10 月 17 日*" msgid "This is the fourth release in the Django 1.3 series." msgstr "这是 Django 1.3 系列的第四个版本。" msgid "Host header poisoning" msgstr "Host 头部中毒" msgid "" "Some parts of Django -- independent of end-user-written applications -- make " "use of full URLs, including domain name, which are generated from the HTTP " "Host header. Some attacks against this are beyond Django's ability to " "control, and require the web server to be properly configured; Django's " "documentation has for some time contained notes advising users on such " "configuration." msgstr "" "Django 的某些部分(与最终用户编写的应用程序无关)使用完整的 URL,包括从 HTTP " "Host 头生成的域名。针对此类问题的一些攻击超出了 Django 的控制能力,需要正确配" "置 Web 服务器; Django 的文档已经包含了一段时间的说明,建议用户进行此类配置。" msgid "" "Django's own built-in parsing of the Host header is, however, still " "vulnerable, as was reported to us recently. The Host header parsing in " "Django 1.3.3 and Django 1.4.1 -- specifically, ``django.http.HttpRequest." "get_host()`` -- was incorrectly handling username/password information in " "the header. Thus, for example, the following Host header would be accepted " "by Django when running on ``validsite.com``:" msgstr "" "然而,Django 自身内置的 Host 标头解析仍然存在漏洞,最近有人向我们报告了这个问" "题。Django 1.3.3 和 Django 1.4.1 中的 Host 标头解析 -- 具体来说是 ``django." "http.HttpRequest.get_host()`` -- 在处理标头中的用户名/密码信息时出现了错误。" "因此,例如,在运行在 ``validsite.com`` 上时,Django 会接受以下 Host 标头:" msgid "" "Using this, an attacker can cause parts of Django -- particularly the " "password-reset mechanism -- to generate and display arbitrary URLs to users." msgstr "" "利用这一点,攻击者可以使 Django 的部分功能(尤其是密码重置机制)为用户生成并" "显示任意 URL 。" msgid "" "To remedy this, the parsing in ``HttpRequest.get_host()`` is being modified; " "Host headers which contain potentially dangerous content (such as username/" "password pairs) now raise the exception :exc:`django.core.exceptions." "SuspiciousOperation`." msgstr "" "为了解决这个问题,``HttpRequest.get_host()`` 中的解析正在被修改;包含潜在危险" "内容(如用户名/密码对)的 Host 标头现在会引发异常 :exc:`django.core." "exceptions.SuspiciousOperation`。" msgid "" "Details of this issue were initially posted online as a `security advisory`_." msgstr "关于这个问题的详细信息最初被发布在网上作为一份 `安全公告`_。" msgid "Django 1.3.5 release notes" msgstr "Django 1.3.5 版本发行说明" msgid "*December 10, 2012*" msgstr "*2012 年 12 月 10 日*" msgid "" "Django 1.3.5 addresses two security issues present in previous Django " "releases in the 1.3 series." msgstr "Django 1.3.5 解决了 1.3 系列中之前 Django 版本存在的两个安全问题。" msgid "" "Please be aware that this security release is slightly different from " "previous ones. Both issues addressed here have been dealt with in prior " "security updates to Django. In one case, we have received ongoing reports of " "problems, and in the other we've chosen to take further steps to tighten up " "Django's code in response to independent discovery of potential problems " "from multiple sources." msgstr "" "请注意,这个安全发布与之前的发布略有不同。这里解决的两个问题都已在之前的 " "Django 安全更新中得到处理。在一个案例中,我们收到了持续的问题报告,另一个案例" "中,我们选择采取进一步措施来加强 Django 的代码,以应对来自多个来源的潜在问题" "的独立发现。" msgid "" "Several earlier Django security releases focused on the issue of poisoning " "the HTTP Host header, causing Django to generate URLs pointing to arbitrary, " "potentially-malicious domains." msgstr "" "早期的几个 Django 安全发布主要关注 HTTP Host 头部被污染的问题,这会导致 " "Django 生成指向任意、可能恶意的域名的 URL 。" msgid "" "In response to further input received and reports of continuing issues " "following the previous release, we're taking additional steps to tighten " "Host header validation. Rather than attempt to accommodate all features HTTP " "supports here, Django's Host header validation attempts to support a " "smaller, but far more common, subset:" msgstr "" "为了回应收到的进一步意见以及在之前发布后持续出现的问题,我们正在采取额外措施" "来加强 Host 头部验证。与其试图适应 HTTP 支持的所有功能,Django 的 Host 头部验" "证试图支持一个更小但更常见的子集:" msgid "" "Hostnames must consist of characters ``[A-Za-z0-9]`` plus hyphen ('-') or " "dot ('.')." msgstr "主机名必须由字符 ``[A-Za-z0-9]`` 加上连字符('-')或点号('.')组成。" msgid "IP addresses -- both IPv4 and IPv6 -- are permitted." msgstr "允许使用 IP 地址 - 包括 IPv4 和 IPv6 。" msgid "Port, if specified, is numeric." msgstr "如果指定了端口,必须为数字。" msgid "" "Any deviation from this will now be rejected, raising the exception :exc:" "`django.core.exceptions.SuspiciousOperation`." msgstr "" "现在,任何与此不符的都将被拒绝,并引发异常 :exc:`django.core.exceptions." "SuspiciousOperation`。" msgid "Redirect poisoning" msgstr "重定向投毒" msgid "" "Also following up on a previous issue: in July of this year, we made changes " "to Django's HTTP redirect classes, performing additional validation of the " "scheme of the URL to redirect to (since, both within Django's own supplied " "applications and many third-party applications, accepting a user-supplied " "redirect target is a common pattern)." msgstr "" "同样是跟进之前的问题:今年 7 月,我们对 Django 的 HTTP 重定向类进行了修改,对" "要重定向到的 URL 的方案进行了额外验证(因为在 Django 自带的应用程序和许多第三" "方应用程序中,接受用户提供的重定向目标是一种常见的模式)。" msgid "" "Since then, two independent audits of the code turned up further potential " "problems. So, similar to the Host-header issue, we are taking steps to " "provide tighter validation in response to reported problems (primarily with " "third-party applications, but to a certain extent also within Django " "itself). This comes in two parts:" msgstr "" "从那时起,对代码进行的两次独立审计发现了更多潜在问题。因此,与 Host-header 问" "题类似,我们正在采取措施提供更严格的验证,以应对报告的问题(主要是与第三方应" "用程序相关,但在一定程度上也涉及 Django 本身)。这分为两部分:" msgid "" "1. A new utility function, ``django.utils.http.is_safe_url``, is added; this " "function takes a URL and a hostname, and checks that the URL is either " "relative, or if absolute matches the supplied hostname. This function is " "intended for use whenever user-supplied redirect targets are accepted, to " "ensure that such redirects cannot lead to arbitrary third-party sites." msgstr "" "1. 新增了一个实用函数 ``django.utils.http.is_safe_url``;该函数接受一个 URL " "和一个主机名,并检查该 URL 是否是相对路径,或者如果是绝对路径,是否与提供的主" "机名匹配。这个函数用于在接受用户提供的重定向目标时,以确保这样的重定向不能导" "致任意的第三方站点。" msgid "" "2. All of Django's own built-in views -- primarily in the authentication " "system -- which allow user-supplied redirect targets now use ``is_safe_url`` " "to validate the supplied URL." msgstr "" "2. Django 的所有内置视图 -- 主要是在身份验证系统中 -- 允许用户提供重定向目标" "的视图现在都使用 ``is_safe_url`` 来验证提供的 URL。" msgid "Django 1.3.6 release notes" msgstr "Django 1.3.6 版本发行说明" msgid "*February 19, 2013*" msgstr "*2013 年 2 月 19 日*" msgid "" "Django 1.3.6 fixes four security issues present in previous Django releases " "in the 1.3 series." msgstr "Django 1.3.6 修复了 1.3 系列中之前 Django 版本存在的四个安全问题。" msgid "This is the sixth bugfix/security release in the Django 1.3 series." msgstr "这是 Django 1.3 系列中的第六个修复错误/安全性发布。" msgid "" "Some parts of Django -- independent of end-user-written applications -- make " "use of full URLs, including domain name, which are generated from the HTTP " "Host header. Django's documentation has for some time contained notes " "advising users on how to configure web servers to ensure that only valid " "Host headers can reach the Django application. However, it has been reported " "to us that even with the recommended web server configurations there are " "still techniques available for tricking many common web servers into " "supplying the application with an incorrect and possibly malicious Host " "header." msgstr "" "Django 的某些部分(与最终用户编写的应用程序无关)使用包含域名的完整 URL,这" "些 URL 是根据 HTTP Host 头生成的。 Django 的文档已经包含了一些关于如何配置 " "Web 服务器以确保只有有效的 Host 头才能到达 Django 应用程序的建议。然而,有人" "向我们报告称,即使采用了建议的 Web 服务器配置,仍然有一些方法可以欺骗许多常见" "的 Web 服务器,使它们向应用程序提供错误且可能恶意的 Host 头。" msgid "" "For this reason, Django 1.3.6 adds a new setting, ``ALLOWED_HOSTS``, which " "should contain an explicit list of valid host/domain names for this site. A " "request with a Host header not matching an entry in this list will raise " "``SuspiciousOperation`` if ``request.get_host()`` is called. For full " "details see the documentation for the :setting:`ALLOWED_HOSTS` setting." msgstr "" "因此,Django 1.3.6 添加了一个新的设置,``ALLOWED_HOSTS``,它应包含站点的有效" "主机/域名的显式列表。如果调用 ``request.get_host()`` 的请求的 Host 标头与此列" "表中的条目不匹配,将引发 ``SuspiciousOperation``。有关 :setting:" "`ALLOWED_HOSTS` 设置的详细信息,请参阅文档。" msgid "" "The default value for this setting in Django 1.3.6 is ``['*']`` (matching " "any host), for backwards-compatibility, but we strongly encourage all sites " "to set a more restrictive value." msgstr "" "在 Django 1.3.6 中,这个设置的默认值是 ``['*']`` (匹配任何主机),出于向后兼" "容性考虑,但我们强烈建议所有站点设置一个更加限制的值。" msgid "" "This host validation is disabled when ``DEBUG`` is ``True`` or when running " "tests." msgstr "当 ``DEBUG`` 为 ``True`` 时或在运行测试时,主机验证会被禁用。" msgid "XML deserialization" msgstr "XML 反序列化" msgid "" "The XML parser in the Python standard library is vulnerable to a number of " "attacks via external entities and entity expansion. Django uses this parser " "for deserializing XML-formatted database fixtures. The fixture deserializer " "is not intended for use with untrusted data, but in order to err on the side " "of safety in Django 1.3.6 the XML deserializer refuses to parse an XML " "document with a DTD (DOCTYPE definition), which closes off these attack " "avenues." msgstr "" "Python 标准库中的 XML 解析器容易受到外部实体和实体扩展攻击。 Django 使用此解" "析器对 XML 格式的数据库固件进行反序列化。固件反序列化器并非用于处理不受信任的" "数据,但为了在 Django 1.3.6 中确保安全,XML 反序列化器拒绝解析带有 DTD" "(DOCTYPE 定义)的 XML 文档,从而关闭了这些攻击途径。" msgid "" "These issues in the Python standard library are CVE-2013-1664 and " "CVE-2013-1665. More information available `from the Python security team`_." msgstr "" "Python 标准库中的这些问题是 CVE-2013-1664 和 CVE-2013-1665。可以从 `Python 安" "全团队`_ 获取更多信息。" msgid "" "Django's XML serializer does not create documents with a DTD, so this should " "not cause any issues with the typical round-trip from ``dumpdata`` to " "``loaddata``, but if you feed your own XML documents to the ``loaddata`` " "management command, you will need to ensure they do not contain a DTD." msgstr "" "Django 的 XML 序列化器不会创建带有 DTD 的文档,因此这不应该导致从 " "``dumpdata`` 到 ``loaddata`` 的典型往返出现任何问题。但是,如果您向 " "``loaddata`` 管理命令提供自己的 XML 文档,您需要确保它们不包含 DTD。" msgid "Formset memory exhaustion" msgstr "表单集内存耗尽" msgid "" "Previous versions of Django did not validate or limit the form-count data " "provided by the client in a formset's management form, making it possible to " "exhaust a server's available memory by forcing it to create very large " "numbers of forms." msgstr "" "以前的 Django 版本没有验证或限制表单集管理表单中由客户端提供的表单计数数据," "这使得通过强制创建大量表单来耗尽服务器可用内存成为可能。" msgid "" "In Django 1.3.6, all formsets have a strictly-enforced maximum number of " "forms (1000 by default, though it can be set higher via the ``max_num`` " "formset factory argument)." msgstr "" "在 Django 1.3.6 中,所有的表单集都有一个严格执行的最大表单数量限制(默认为 " "1000,但可以通过表单集工厂参数 ``max_num`` 设置得更高)。" msgid "Admin history view information leakage" msgstr "管理员历史视图信息泄露" msgid "" "In previous versions of Django, an admin user without change permission on a " "model could still view the Unicode representation of instances via their " "admin history log. Django 1.3.6 now limits the admin history log view for an " "object to users with change permission for that model." msgstr "" "在以前的 Django 版本中,一个没有模型更改权限的管理员用户仍然可以通过其管理员" "历史日志查看实例的 Unicode 表示。 Django 1.3.6 现在将对象的管理员历史日志视图" "限制为具有该模型更改权限的用户。" msgid "Django 1.3.7 release notes" msgstr "Django 1.3.7 版本发行说明" msgid "*February 20, 2013*" msgstr "*2013 年 2 月 20 日*" msgid "" "Django 1.3.7 corrects a packaging problem with yesterday's :doc:`1.3.6 " "release `." msgstr "" "Django 1.3.7 修复了昨天发布的 :doc:`1.3.6 版本 ` 中的打包问" "题。" msgid "" "The release contained stray ``.pyc`` files that caused \"bad magic number\" " "errors when running with some versions of Python. This releases corrects " "this, and also fixes a bad documentation link in the project template " "``settings.py`` file generated by ``manage.py startproject``." msgstr "" "该版本包含了零散的 ``.pyc`` 文件,在某些版本的 Python 中运行时会导致 \"bad " "magic number\" 错误。这个版本修复了这个问题,并且还修复了由 ``manage.py " "startproject`` 生成的项目模板 ``settings.py`` 文件中的错误文档链接。" msgid "Django 1.4 release notes" msgstr "Django 1.4 版本发行说明" msgid "*March 23, 2012*" msgstr "*2012 年 3 月 23 日*" msgid "Welcome to Django 1.4!" msgstr "欢迎来到 Django 1.4 版本!" msgid "" "These release notes cover the :ref:`new features `, as well " "as some :ref:`backwards incompatible changes ` " "you'll want to be aware of when upgrading from Django 1.3 or older versions. " "We've also dropped some features, which are detailed in :ref:`our " "deprecation plan `, and we've :ref:`begun the " "deprecation process for some features `." msgstr "" "这些发布说明涵盖了 :ref:`新特性 `,以及从 Django 1.3 或更早版" "本升级时需要注意的一些 :ref:`不向后兼容的变更 `。" "我们还放弃了一些功能,详细信息在 :ref:`我们的弃用计划 ` 中说明,并且我们已经 :ref:`开始了一些功能的弃用过程 `。" msgid "" "The biggest new feature in Django 1.4 is `support for time zones`_ when " "handling date/times. When enabled, this Django will store date/times in UTC, " "use timezone-aware objects internally, and translate them to users' local " "timezones for display." msgstr "" "Django 1.4 中最重要的新特性是在处理日期/时间时提供了对时区的支持。当启用时," "Django 将在 UTC 中存储日期/时间,内部使用时区感知的对象,并将它们翻译为用户的" "本地时区以供显示。" msgid "" "If you're upgrading an existing project to Django 1.4, switching to the " "timezone aware mode may take some care: the new mode disallows some rather " "sloppy behavior that used to be accepted. We encourage anyone who's " "upgrading to check out the :ref:`timezone migration guide ` and the :ref:`timezone FAQ ` for useful " "pointers." msgstr "" "如果您正在将现有项目升级到 Django 1.4,切换到时区感知模式可能需要一些注意:新" "模式不允许以前被接受的一些相当松散的行为。我们鼓励任何升级的用户查看 :ref:`时" "区迁移指南 ` 和 :ref:`时区常见问题解答 `,以获取有用的提示。" msgid "Other notable new features in Django 1.4 include:" msgstr "Django 1.4 中其他值得关注的新功能包括:" msgid "" "A number of ORM improvements, including `SELECT FOR UPDATE support`_, the " "ability to `bulk insert <#model-objects-bulk-create-in-the-orm>`_ large " "datasets for improved performance, and `QuerySet.prefetch_related`_, a " "method to batch-load related objects in areas where :meth:`~django.db.models." "query.QuerySet.select_related` doesn't work." msgstr "" "ORM 改进方面有很多改进,包括 `SELECT FOR UPDATE 支持`_,能够以 `bulk " "insert`_ 的方式插入大型数据集以提高性能,以及 `QuerySet.prefetch_related`_," "这是一种在 :meth:`~django.db.models.query.QuerySet.select_related` 不适用的情" "况下批量加载相关对象的方法。" msgid "" "Some nice security additions, including `improved password hashing`_ " "(featuring PBKDF2_ and bcrypt_ support), new `tools for cryptographic " "signing`_, several `CSRF improvements`_, and `simple clickjacking " "protection`_." msgstr "" "一些不错的安全性增强功能,包括 `改进的密码哈希算法`_ (支持 PBKDF2_ 和 " "bcrypt_),新的 `加密签名工具`_,几个 `CSRF 改进`_,以及 `简单的点击劫持保护" "`_。" msgid "" "An `updated default project layout and manage.py`_ that removes the " "\"magic\" from prior versions. And for those who don't like the new layout, " "you can use `custom project and app templates`_ instead!" msgstr "" "`更新的默认项目布局和 manage.py`_ ,去除了以前版本中的\"魔法\"。对于那些不喜" "欢新布局的人,可以使用 `自定义项目和应用模板`_。" msgid "`Support for in-browser testing frameworks`_ (like Selenium_)." msgstr "`对于浏览器内测试框架的支持`_ (如 Selenium_)。" msgid "... and a whole lot more; `see below <#what-s-new-in-django-1-4>`_!" msgstr "... 还有很多内容;`查看下文 <#what-s-new-in-django-1-4>`_!" msgid "" "Wherever possible we try to introduce new features in a backwards-compatible " "manner per :doc:`our API stability policy ` policy. " "However, as with previous releases, Django 1.4 ships with some minor :ref:" "`backwards incompatible changes `; people " "upgrading from previous versions of Django should read that list carefully." msgstr "" "在尽可能的情况下,我们尝试以符合 :doc:`我们的 API 稳定性政策 ` 的方式引入新功能。然而,与以前的版本一样,Django 1.4 也带有一些轻" "微的 :ref:`不兼容变更 `;从以前版本的 Django 升级" "的用户应该仔细阅读该列表。" msgid "" "Django 1.4 has dropped support for Python 2.4. Python 2.5 is now the minimum " "required Python version. Django is tested and supported on Python 2.5, 2.6 " "and 2.7." msgstr "" "Django 1.4 已放弃对 Python 2.4 的支持。现在要求的最低 Python 版本为 2.5 。 " "Django 在 Python 2.5 、 2.6 和 2.7 上经过测试并得到支持。" msgid "" "This change should affect only a small number of Django users, as most " "operating-system vendors today are shipping Python 2.5 or newer as their " "default version. If you're still using Python 2.4, however, you'll need to " "stick to Django 1.3 until you can upgrade. Per :doc:`our support policy `, Django 1.3 will continue to receive security " "support until the release of Django 1.5." msgstr "" "这个变更应该只会影响到少数 Django 用户,因为大多数操作系统厂商今天都默认安装 " "Python 2.5 或更新版本。然而,如果你仍然在使用 Python 2.4,你将需要继续使用 " "Django 1.3,直到你可以升级。根据 :doc:`我们的支持政策 `,Django 1.3 将在 Django 1.5 发布之前继续获得安全支持。" msgid "" "Django does not support Python 3.x at this time. At some point before the " "release of Django 1.4, we plan to publish a document outlining our full " "timeline for deprecating Python 2.x and moving to Python 3.x." msgstr "" "目前 Django 不支持 Python 3.x 。在 Django 1.4 发布之前的某个时刻,我们计划发" "布一份文件,概述我们废弃 Python 2.x 并转向 Python 3.x 的完整时间表。" msgid "What's new in Django 1.4" msgstr "Django 1.4 新特性" msgid "Support for time zones" msgstr "时区支持" msgid "" "In previous versions, Django used \"naive\" date/times (that is, date/times " "without an associated time zone), leaving it up to each developer to " "interpret what a given date/time \"really means\". This can cause all sorts " "of subtle timezone-related bugs." msgstr "" "在以前的版本中,Django 使用了“天真”的日期/时间(也就是没有关联时区的日期/时" "间),让每个开发者来解释给定的日期/时间“真正的含义”。这可能导致各种微妙的时区" "相关错误。" msgid "" "In Django 1.4, you can now switch Django into a more correct, time-zone " "aware mode. In this mode, Django stores date and time information in UTC in " "the database, uses time-zone-aware datetime objects internally and " "translates them to the end user's time zone in templates and forms. Reasons " "for using this feature include:" msgstr "" "在 Django 1.4 中,您现在可以将 Django 切换到更正确的、具有时区感知的模式。在" "此模式下,Django 将日期和时间信息以 UTC 格式存储在数据库中,内部使用具有时区" "感知的 datetime 对象,并在模板和表单中将它们转换为最终用户的时区。使用此功能" "的原因包括:" msgid "Customizing date and time display for users around the world." msgstr "为世界各地的用户自定义日期和时间显示。" msgid "" "Storing datetimes in UTC for database portability and interoperability. " "(This argument doesn't apply to PostgreSQL, because it already stores " "timestamps with time zone information in Django 1.3.)" msgstr "" "以 UTC 格式存储日期时间以实现数据库的可移植性和互操作性。(这个论点不适用于 " "PostgreSQL,因为在 Django 1.3 中,它已经存储了带有时区信息的时间戳。)" msgid "Avoiding data corruption problems around DST transitions." msgstr "避免在夏令时转换期间出现数据损坏问题。" msgid "" "Time zone support is enabled by default in new projects created with :" "djadmin:`startproject`. If you want to use this feature in an existing " "project, read the :ref:`migration guide `. If " "you encounter problems, there's a helpful :ref:`FAQ `." msgstr "" "在使用 :djadmin:`startproject` 创建的新项目中,默认启用了时区支持。如果你想在" "现有项目中使用这个功能,请阅读 :ref:`迁移指南 `。" "如果遇到问题,可以参考有用的 :ref:`常见问题解答 `。" msgid "Support for in-browser testing frameworks" msgstr "支持基于浏览器的测试框架" msgid "" "Django 1.4 supports integration with in-browser testing frameworks like " "Selenium_. The new :class:`django.test.LiveServerTestCase` base class lets " "you test the interactions between your site's front and back ends more " "comprehensively. See the :class:`documentation` for more details and concrete examples." msgstr "" "Django 1.4 支持与浏览器测试框架(如 Selenium_)的集成。新的 :class:`django." "test.LiveServerTestCase` 基类允许你更全面地测试你的网站前端和后端之间的交互。" "有关更多详细信息和具体示例,请参阅 :class:`文档 `。" msgid "Updated default project layout and ``manage.py``" msgstr "更新了默认项目布局和 ``manage.py``。" msgid "" "Django 1.4 ships with an updated default project layout and ``manage.py`` " "file for the :djadmin:`startproject` management command. These fix some " "issues with the previous ``manage.py`` handling of Python import paths that " "caused double imports, trouble moving from development to deployment, and " "other difficult-to-debug path issues." msgstr "" "Django 1.4 附带了一个更新后的默认项目布局和 :djadmin:`startproject` 管理命令" "的 ``manage.py`` 文件。这些修复了之前的 ``manage.py`` 处理 Python 导入路径的" "一些问题,导致了重复导入、从开发环境切换到部署环境的困难以及其他难以调试的路" "径问题。" msgid "" "The previous ``manage.py`` called functions that are now deprecated, and " "thus projects upgrading to Django 1.4 should update their ``manage.py``. " "(The old-style ``manage.py`` will continue to work as before until Django " "1.6. In 1.5 it will raise ``DeprecationWarning``)." msgstr "" "之前的 ``manage.py`` 调用了现在已弃用的函数,因此升级到 Django 1.4 的项目应该" "更新他们的 ``manage.py``。(旧式的 ``manage.py`` 将在 Django 1.6 之前继续像以" "前一样工作。在 1.5 中,它将引发 ``DeprecationWarning``)。" msgid "The new recommended ``manage.py`` file should look like this::" msgstr "推荐使用的新 ``manage.py`` 文件应该如下所示:" msgid "" "``{{ project_name }}`` should be replaced with the Python package name of " "the actual project." msgstr "``{{ project_name }}`` 应该替换为实际项目的 Python 包名称。" msgid "" "If settings, URLconfs and apps within the project are imported or referenced " "using the project name prefix (e.g. ``myproject.settings``, ``ROOT_URLCONF = " "\"myproject.urls\"``, etc.), the new ``manage.py`` will need to be moved one " "directory up, so it is outside the project package rather than adjacent to " "``settings.py`` and ``urls.py``." msgstr "" "如果项目中导入或引用了设置、URL 配置和应用程序时使用项目名称前缀(例如 " "``myproject.settings``,``ROOT_URLCONF = \"myproject.urls\"`` 等),新的 " "``manage.py`` 需要移动到上一级目录,以便它位于项目包之外,而不是与 " "``settings.py`` 和 ``urls.py`` 并列。" msgid "For instance, with the following layout:" msgstr "例如,以下布局:" msgid "" "You could import ``mysite.settings``, ``mysite.urls``, and ``mysite.myapp``, " "but not ``settings``, ``urls``, or ``myapp`` as top-level modules." msgstr "" "你可以导入 ``mysite.settings``、``mysite.urls`` 和 ``mysite.myapp``,但不能导" "入 ``settings``、``urls`` 或 ``myapp`` 作为顶级模块。" msgid "" "Anything imported as a top-level module can be placed adjacent to the new " "``manage.py``. For instance, to decouple ``myapp`` from the project module " "and import it as just ``myapp``, place it outside the ``mysite/`` directory:" msgstr "" "作为顶级模块导入的任何内容都可以放在新的 ``manage.py`` 旁边。例如,要将 " "``myapp`` 与项目模块解耦并将其导入为 ``myapp``,请将其放在 ``mysite/`` 目录之" "外:" msgid "" "If the same code is imported inconsistently (some places with the project " "prefix, some places without it), the imports will need to be cleaned up when " "switching to the new ``manage.py``." msgstr "" "如果相同的代码在不一致的地方导入(有些地方使用项目前缀,有些地方不使用),在" "切换到新的 ``manage.py`` 时需要清理导入语句。" msgid "Custom project and app templates" msgstr "自定义项目和应用模板" msgid "" "The :djadmin:`startapp` and :djadmin:`startproject` management commands now " "have a ``--template`` option for specifying a path or URL to a custom app or " "project template." msgstr "" "现在,:djadmin:`startapp` 和 :djadmin:`startproject` 管理命令都有一个 ``--" "template`` 选项,用于指定自定义应用程序或项目模板的路径或 URL。" msgid "" "For example, Django will use the ``/path/to/my_project_template`` directory " "when you run the following command:" msgstr "" "例如,当你运行以下命令时,Django 将使用 ``/path/to/my_project_template`` 目" "录:" msgid "" "You can also now provide a destination directory as the second argument to " "both :djadmin:`startapp` and :djadmin:`startproject`:" msgstr "" "现在,你也可以将目标目录作为 :djadmin:`startapp` 和 :djadmin:`startproject` " "的第二个参数提供:" msgid "" "For more information, see the :djadmin:`startapp` and :djadmin:" "`startproject` documentation." msgstr "" "有关更多信息,请参阅 :djadmin:`startapp` 和 :djadmin:`startproject` 的文档。" msgid "Improved WSGI support" msgstr "改进的 WSGI 支持" msgid "" "The :djadmin:`startproject` management command now adds a :file:`wsgi.py` " "module to the initial project layout, containing a simple WSGI application " "that can be used for :doc:`deploying with WSGI app servers`." msgstr "" ":djadmin:`startproject` 管理命令现在会在初始项目布局中添加一个 :file:`wsgi." "py` 模块,其中包含一个简单的 WSGI 应用程序,可以用于 :doc:`使用 WSGI 应用服务" "器部署 `。" msgid "" "The :djadmin:`built-in development server` now supports using an " "externally-defined WSGI callable, which makes it possible to run " "``runserver`` with the same WSGI configuration that is used for deployment. " "The new :setting:`WSGI_APPLICATION` setting lets you configure which WSGI " "callable :djadmin:`runserver` uses." msgstr "" "内置的开发服务器 :djadmin:`runserver` 现在支持使用外部定义的 WSGI 可调用函" "数,这使得可以使用与部署相同的 WSGI 配置来运行 ``runserver``。新的 :setting:" "`WSGI_APPLICATION` 设置允许你配置 :djadmin:`runserver` 使用哪个 WSGI 可调用函" "数。" msgid "" "(The ``runfcgi`` management command also internally wraps the WSGI callable " "configured via :setting:`WSGI_APPLICATION`.)" msgstr "" "(``runfcgi`` 管理命令也会在内部包装通过 :setting:`WSGI_APPLICATION` 配置的 " "WSGI 可调用函数。)" msgid "``SELECT FOR UPDATE`` support" msgstr "``SELECT FOR UPDATE`` 支持" msgid "" "Django 1.4 includes a :meth:`QuerySet.select_for_update() ` method, which generates a ``SELECT ... " "FOR UPDATE`` SQL query. This will lock rows until the end of the " "transaction, meaning other transactions cannot modify or delete rows matched " "by a ``FOR UPDATE`` query." msgstr "" "Django 1.4 包含了一个 :meth:`QuerySet.select_for_update() ` 方法,它生成一个 ``SELECT ... FOR " "UPDATE`` SQL 查询。这将锁定行,直到事务结束,这意味着其他事务无法修改或删除" "与 ``FOR UPDATE`` 查询匹配的行。" msgid "" "For more details, see the documentation for :meth:`~django.db.models.query." "QuerySet.select_for_update`." msgstr "" "有关更多详细信息,请参阅 :meth:`~django.db.models.query.QuerySet." "select_for_update` 的文档。" msgid "``Model.objects.bulk_create`` in the ORM" msgstr "ORM 中的 ``Model.objects.bulk_create``" msgid "" "This method lets you create multiple objects more efficiently. It can result " "in significant performance increases if you have many objects." msgstr "" "这种方法让您能够更高效地创建多个对象。如果您有很多对象,这可能会带来显著的性" "能提升。" msgid "" "Django makes use of this internally, meaning some operations (such as " "database setup for test suites) have seen a performance benefit as a result." msgstr "" "Django 在内部使用了这种方法,这意味着某些操作(如测试套件的数据库设置)因此也" "获得了性能提升。" msgid "" "See the :meth:`~django.db.models.query.QuerySet.bulk_create` docs for more " "information." msgstr "" "请查看 :meth:`~django.db.models.query.QuerySet.bulk_create` 文档以获取更多信" "息。" msgid "``QuerySet.prefetch_related``" msgstr "``QuerySet.prefetch_related``" msgid "" "Similar to :meth:`~django.db.models.query.QuerySet.select_related` but with " "a different strategy and broader scope, :meth:`~django.db.models.query." "QuerySet.prefetch_related` has been added to :class:`~django.db.models.query." "QuerySet`. This method returns a new ``QuerySet`` that will prefetch each of " "the specified related lookups in a single batch as soon as the query begins " "to be evaluated. Unlike ``select_related``, it does the joins in Python, not " "in the database, and supports many-to-many relationships, " "``GenericForeignKey`` and more. This allows you to fix a very common " "performance problem in which your code ends up doing O(n) database queries " "(or worse) if objects on your primary ``QuerySet`` each have many related " "objects that you also need to fetch." msgstr "" "类似于 :meth:`~django.db.models.query.QuerySet.select_related`,但具有不同策" "略和更广泛的范围,:meth:`~django.db.models.query.QuerySet.prefetch_related` " "已经添加到 :class:`~django.db.models.query.QuerySet` 中。这个方法返回一个新" "的 ``QuerySet``,将在查询开始被评估时以单个批次的方式预取每个指定的相关查找。" "与 ``select_related`` 不同,它在 Python 中执行连接操作,而不是在数据库中执" "行,并支持多对多关系、``GenericForeignKey`` 等。这允许您解决一个非常常见的性" "能问题,即如果主要 ``QuerySet`` 上的对象每个都有许多相关对象需要获取,那么您" "的代码最终会执行 O(n) 数据库查询(或更糟)。" msgid "Improved password hashing" msgstr "改进的密码散列处理" msgid "" "Django's auth system (``django.contrib.auth``) stores passwords using a one-" "way algorithm. Django 1.3 uses the SHA1_ algorithm, but increasing processor " "speeds and theoretical attacks have revealed that SHA1 isn't as secure as " "we'd like. Thus, Django 1.4 introduces a new password storage system: by " "default Django now uses the PBKDF2_ algorithm (as recommended by NIST_). You " "can also easily choose a different algorithm (including the popular bcrypt_ " "algorithm). For more details, see :ref:`auth_password_storage`." msgstr "" "Django 的认证系统(``django.contrib.auth``)使用单向算法存储密码。Django 1.3 " "使用 SHA1_ 算法,但随着处理器速度的增加和理论攻击的出现,SHA1 的安全性不如我" "们希望的那么高。因此,Django 1.4 引入了一个新的密码存储系统:默认情况下," "Django 现在使用 PBKDF2_ 算法(由 NIST_ 推荐)。您还可以轻松选择不同的算法(包" "括流行的 bcrypt_ 算法)。有关更多详细信息,请参阅 :ref:" "`auth_password_storage`。" msgid "HTML5 doctype" msgstr "HTML5 文档类型定义(doctype)" msgid "" "We've switched the admin and other bundled templates to use the HTML5 " "doctype. While Django will be careful to maintain compatibility with older " "browsers, this change means that you can use any HTML5 features you need in " "admin pages without having to lose HTML validity or override the provided " "templates to change the doctype." msgstr "" "我们已经将管理员和其他捆绑模板切换为使用 HTML5 文档类型定义。尽管 Django 会小" "心地保持与旧浏览器的兼容性,但这一变化意味着您可以在管理员页面中使用所需的任" "何 HTML5 功能,而无需失去 HTML 有效性或覆盖提供的模板以更改文档类型定义。" msgid "List filters in admin interface" msgstr "管理员界面的列表过滤器" msgid "" "Prior to Django 1.4, the :mod:`~django.contrib.admin` app let you specify " "change list filters by specifying a field lookup, but it didn't allow you to " "create custom filters. This has been rectified with a simple API (previously " "used internally and known as \"FilterSpec\"). For more details, see the " "documentation for :attr:`~django.contrib.admin.ModelAdmin.list_filter`." msgstr "" "在 Django 1.4 之前,:mod:`~django.contrib.admin` 应用程序允许您通过指定字段查" "找来指定更改列表过滤器,但不允许您创建自定义过滤器。这已经得到了纠正,并引入" "了一个简单的 API(以前在内部使用,被称为 \"FilterSpec\")。有关更多详细信息," "请参阅 :attr:`~django.contrib.admin.ModelAdmin.list_filter` 的文档。" msgid "Multiple sort in admin interface" msgstr "管理员界面的多重排序功能" msgid "" "The admin change list now supports sorting on multiple columns. It respects " "all elements of the :attr:`~django.contrib.admin.ModelAdmin.ordering` " "attribute, and sorting on multiple columns by clicking on headers is " "designed to mimic the behavior of desktop GUIs. We also added a :meth:" "`~django.contrib.admin.ModelAdmin.get_ordering` method for specifying the " "ordering dynamically (i.e., depending on the request)." msgstr "" "管理界面的更改列表现在支持在多个列上进行排序。它尊重 :attr:`~django.contrib." "admin.ModelAdmin.ordering` 属性的所有元素,并且通过单击标题进行多列排序的行为" "设计得类似于桌面 GUI。我们还添加了一个 :meth:`~django.contrib.admin." "ModelAdmin.get_ordering` 方法,用于动态指定排序顺序(即,根据请求的不同情" "况)。" msgid "New ``ModelAdmin`` methods" msgstr "新的 ``ModelAdmin`` 方法" msgid "" "We added a :meth:`~django.contrib.admin.ModelAdmin.save_related` method to :" "mod:`~django.contrib.admin.ModelAdmin` to ease customization of how related " "objects are saved in the admin." msgstr "" "我们在 :mod:`~django.contrib.admin.ModelAdmin` 中添加了一个 :meth:`~django." "contrib.admin.ModelAdmin.save_related` 方法,以便更容易自定义在管理员中保存相" "关对象的方式。" msgid "" "Two other new :class:`~django.contrib.admin.ModelAdmin` methods, :meth:" "`~django.contrib.admin.ModelAdmin.get_list_display` and :meth:`~django." "contrib.admin.ModelAdmin.get_list_display_links` enable dynamic " "customization of fields and links displayed on the admin change list." msgstr "" "另外两个新的 :class:`~django.contrib.admin.ModelAdmin` 方法,:meth:`~django." "contrib.admin.ModelAdmin.get_list_display` 和 :meth:`~django.contrib.admin." "ModelAdmin.get_list_display_links`,允许动态自定义在管理员更改列表上显示的字" "段和链接。" msgid "Admin inlines respect user permissions" msgstr "管理员内联遵循用户权限" msgid "" "Admin inlines now only allow those actions for which the user has " "permission. For ``ManyToMany`` relationships with an auto-created " "intermediate model (which does not have its own permissions), the change " "permission for the related model determines if the user has the permission " "to add, change or delete relationships." msgstr "" "管理员内联现在只允许用户具有权限的操作。对于具有自动创建的中间模型的 " "``ManyToMany`` 关系(该模型没有自己的权限),相关模型的更改权限确定用户是否具" "有添加、更改或删除关系的权限。" msgid "Tools for cryptographic signing" msgstr "加密签名工具" msgid "" "Django 1.4 adds both a low-level API for signing values and a high-level API " "for setting and reading signed cookies, one of the most common uses of " "signing in web applications." msgstr "" "Django 1.4 既添加了用于签名值的低级 API,也添加了用于设置和读取签名 Cookie 的" "高级 API,这是 Web 应用程序中签名的最常见用途之一。" msgid "" "See the :doc:`cryptographic signing ` docs for more " "information." msgstr "有关更多信息,请查看 :doc:`加密签名 ` 文档。" msgid "Cookie-based session backend" msgstr "基于 Cookie 的会话后端" msgid "" "Django 1.4 introduces a cookie-based session backend that uses the tools " "for :doc:`cryptographic signing ` to store the session data " "in the client's browser." msgstr "" "Django 1.4 引入了一种基于 Cookie 的会话后端,它使用 :doc:`加密签名 ` 工具来将会话数据存储在客户端的浏览器中。" msgid "" "Session data is signed and validated by the server, but it's not encrypted. " "This means a user can view any data stored in the session but cannot change " "it. Please read the documentation for further clarification before using " "this backend." msgstr "" "会话数据由服务器签名并验证,但不加密。这意味着用户可以查看存储在会话中的任何" "数据,但不能更改它。在使用此后端之前,请阅读文档以进一步了解。" msgid "" "See the :ref:`cookie-based session backend ` docs " "for more information." msgstr "" "有关更多信息,请查看 :ref:`基于 Cookie 的会话后端 ` " "文档。" msgid "New form wizard" msgstr "新的表单向导" msgid "" "The previous ``FormWizard`` from ``django.contrib.formtools`` has been " "replaced with a new implementation based on the class-based views introduced " "in Django 1.3. It features a pluggable storage API and doesn't require the " "wizard to pass around hidden fields for every previous step." msgstr "" "以前的 ``FormWizard`` 从 ``django.contrib.formtools`` 已经被一个基于 Django " "1.3 引入的基于类的视图的新实现替代。它具有可插拔的存储 API,并且不需要向前的" "每个步骤传递隐藏字段。" msgid "" "Django 1.4 ships with a session-based storage backend and a cookie-based " "storage backend. The latter uses the tools for :doc:`cryptographic signing ` also introduced in Django 1.4 to store the wizard's state " "in the user's cookies." msgstr "" "Django 1.4 附带了一个基于会话的存储后端和一个基于 Cookie 的存储后端。后者还使" "用了在 Django 1.4 中引入的 :doc:`加密签名 ` 工具来将向导的状" "态存储在用户的 Cookie 中。" msgid "``reverse_lazy``" msgstr "``reverse_lazy``" msgid "" "A lazily evaluated version of ``reverse()`` was added to allow using URL " "reversals before the project's URLconf gets loaded." msgstr "" "新增了一个惰性评估版本的 ``reverse()``,允许在项目的 URL 配置加载之前使用 " "URL 反转。" msgid "Translating URL patterns" msgstr "翻译 URL 模式" msgid "" "Django can now look for a language prefix in the URLpattern when using the " "new :func:`~django.conf.urls.i18n.i18n_patterns` helper function. It's also " "now possible to define translatable URL patterns using ``django.utils." "translation.ugettext_lazy()``. See :ref:`url-internationalization` for more " "information about the language prefix and how to internationalize URL " "patterns." msgstr "" "Django 现在可以在使用新的 :func:`~django.conf.urls.i18n.i18n_patterns` 辅助函" "数时在 URL 模式中查找语言前缀。还可以使用 ``django.utils.translation." "ugettext_lazy()`` 定义可翻译的 URL 模式。有关语言前缀以及如何国际化 URL 模式" "的更多信息,请参阅 :ref:`url-internationalization`。" msgid "" "Contextual translation support for ``{% trans %}`` and ``{% blocktrans %}``" msgstr "对于 ``{% trans %}`` 和 ``{% blocktrans %}``,现在支持上下文翻译。" msgid "" "The :ref:`contextual translation` support introduced in " "Django 1.3 via the ``pgettext`` function has been extended to the :ttag:" "`trans` and :ttag:`blocktrans` template tags using the new ``context`` " "keyword." msgstr "" "在 Django 1.3 中通过 ``pgettext`` 函数引入的 :ref:`上下文翻译` 支持已经扩展到 :ttag:`trans` 和 :ttag:`blocktrans` 模板标签,使用了" "新的 ``context`` 关键字。" msgid "Customizable ``SingleObjectMixin`` URLConf kwargs" msgstr "可自定义的 ``SingleObjectMixin`` URLConf kwargs" msgid "" "Two new attributes, :attr:`pk_url_kwarg` and :attr:`slug_url_kwarg`, have been added to :class:" "`~django.views.generic.detail.SingleObjectMixin` to enable the customization " "of URLconf keyword arguments used for single object generic views." msgstr "" "为了允许自定义用于单个对象通用视图的 URLconf 关键字参数,新增了两个新属性::" "attr:`pk_url_kwarg` 和 :attr:`slug_url_kwarg`,它们被添加到 :class:`~django.views." "generic.detail.SingleObjectMixin` 中。" msgid "Assignment template tags" msgstr "赋值模板标签" msgid "" "A new ``assignment_tag`` helper function was added to ``template.Library`` " "to ease the creation of template tags that store data in a specified context " "variable." msgstr "" "新增了一个名为 ``assignment_tag`` 的辅助函数到 ``template.Library``,用于简化" "创建模板标签并将数据存储在指定的上下文变量中。" msgid "``*args`` and ``**kwargs`` support for template tag helper functions" msgstr "模板标签辅助函数现在支持 ``*args`` 和 ``**kwargs``" msgid "" "The :ref:`simple_tag`, :ref:" "`inclusion_tag ` and newly " "introduced ``assignment_tag`` template helper functions may now accept any " "number of positional or keyword arguments. For example::" msgstr "" " :ref:`simple_tag `、:ref:" "`inclusion_tag ` 和新引入的 " "``assignment_tag`` 模板辅助函数现在可以接受任意数量的位置参数或关键字参数。例" "如:" msgid "" "Then, in the template, any number of arguments may be passed to the template " "tag. For example:" msgstr "然后,在模板中,可以将任意数量的参数传递给模板标签。例如:" msgid "No wrapping of exceptions in ``TEMPLATE_DEBUG`` mode" msgstr "在 ``TEMPLATE_DEBUG`` 模式下不会包装异常" msgid "" "In previous versions of Django, whenever the ``TEMPLATE_DEBUG`` setting was " "``True``, any exception raised during template rendering (even exceptions " "unrelated to template syntax) were wrapped in ``TemplateSyntaxError`` and re-" "raised. This was done in order to provide detailed template source location " "information in the debug 500 page." msgstr "" "在以前的 Django 版本中,无论何时 ``TEMPLATE_DEBUG`` 设置为 ``True``,在模板渲" "染期间引发的任何异常(甚至与模板语法无关的异常)都会被包装在 " "``TemplateSyntaxError`` 中并重新引发。这是为了在调试 500 页面中提供详细的模板" "源位置信息。" msgid "" "In Django 1.4, exceptions are no longer wrapped. Instead, the original " "exception is annotated with the source information. This means that catching " "exceptions from template rendering is now consistent regardless of the value " "of ``TEMPLATE_DEBUG``, and there's no need to catch and unwrap " "``TemplateSyntaxError`` in order to catch other errors." msgstr "" "在 Django 1.4 中,不再包装异常。相反,原始异常会带有源信息的注释。这意味着无" "论 ``TEMPLATE_DEBUG`` 的值如何,现在捕获模板渲染中的异常都是一致的,而且不需" "要捕获和解包 ``TemplateSyntaxError`` 以捕获其他错误。" msgid "``truncatechars`` template filter" msgstr "``truncatechars`` 模板过滤器" msgid "" "This new filter truncates a string to be no longer than the specified number " "of characters. Truncated strings end with a translatable ellipsis sequence " "(\"...\"). See the documentation for :tfilter:`truncatechars` for more " "details." msgstr "" "这个新的过滤器将字符串截断,使其不超过指定的字符数。截断的字符串以可翻译的省" "略号序列(\"...\")结尾。有关更多详细信息,请参阅 :tfilter:`truncatechars` 的" "文档。" msgid "``static`` template tag" msgstr "``static`` 模板标签" msgid "" "The :mod:`staticfiles` contrib app has a new " "``static`` template tag to refer to files saved with the :setting:" "`STATICFILES_STORAGE` storage backend. It uses the storage backend's ``url`` " "method and therefore supports advanced features such as :ref:`serving files " "from a cloud service`." msgstr "" ":mod:`staticfiles` contrib 应用程序具有一个新的 " "``static`` 模板标签,用于引用使用 :setting:`STATICFILES_STORAGE` 存储后端保存" "的文件。它使用存储后端的 ``url`` 方法,因此支持高级功能,例如 :ref:`从云服务" "提供文件 `。" msgid "``CachedStaticFilesStorage`` storage backend" msgstr "``CachedStaticFilesStorage`` 存储后端" msgid "" "The :mod:`staticfiles` contrib app now has a " "``django.contrib.staticfiles.storage.CachedStaticFilesStorage`` backend that " "caches the files it saves (when running the :djadmin:`collectstatic` " "management command) by appending the MD5 hash of the file's content to the " "filename. For example, the file ``css/styles.css`` would also be saved as " "``css/styles.55e7cbb9ba48.css``" msgstr "" "现在,:mod:`staticfiles` 贡献应用程序具有一个 " "``django.contrib.staticfiles.storage.CachedStaticFilesStorage`` 后端,通过将" "文件内容的 MD5 哈希附加到文件名中来缓存它保存的文件(在运行 :djadmin:" "`collectstatic` 管理命令时)。例如,文件 ``css/styles.css`` 也将保存为 ``css/" "styles.55e7cbb9ba48.css``。" msgid "Simple clickjacking protection" msgstr "简单的点击劫持保护" msgid "" "We've added a middleware to provide easy protection against `clickjacking " "`_ using the ``X-Frame-Options`` " "header. It's not enabled by default for backwards compatibility reasons, but " "you'll almost certainly want to :doc:`enable it ` to " "help plug that security hole for browsers that support the header." msgstr "" "我们添加了一个中间件,通过使用 ``X-Frame-Options`` 头提供了简单的防止 " "`clickjacking `_ 的保护。出于向后" "兼容性的原因,默认情况下未启用它,但您几乎肯定希望 :doc:`启用它 ` 以帮助修复支持该头的浏览器中的安全漏洞。" msgid "CSRF improvements" msgstr "CSRF 改进" msgid "" "We've made various improvements to our CSRF features, including the :func:" "`~django.views.decorators.csrf.ensure_csrf_cookie` decorator, which can help " "with AJAX-heavy sites; protection for PUT and DELETE requests; and the :" "setting:`CSRF_COOKIE_SECURE` and :setting:`CSRF_COOKIE_PATH` settings, which " "can improve the security and usefulness of CSRF protection. See the :doc:" "`CSRF docs ` for more information." msgstr "" "我们对 CSRF 功能进行了各种改进,包括 :func:`~django.views.decorators.csrf." "ensure_csrf_cookie` 装饰器,它可以帮助处理 AJAX 密集的站点;对 PUT 和 DELETE " "请求的保护;以及 :setting:`CSRF_COOKIE_SECURE` 和 :setting:" "`CSRF_COOKIE_PATH` 设置,它们可以提高 CSRF 保护的安全性和实用性。有关更多信" "息,请参阅 :doc:`CSRF 文档 `。" msgid "Error report filtering" msgstr "错误报告过滤" msgid "" "We added two function decorators, :func:`~django.views.decorators.debug." "sensitive_variables` and :func:`~django.views.decorators.debug." "sensitive_post_parameters`, to allow designating the local variables and " "POST parameters that may contain sensitive information and should be " "filtered out of error reports." msgstr "" "我们添加了两个函数装饰器,:func:`~django.views.decorators.debug." "sensitive_variables` 和 :func:`~django.views.decorators.debug." "sensitive_post_parameters`,允许指定可能包含敏感信息并且应该从错误报告中过滤" "掉的本地变量和 POST 参数。" msgid "" "All POST parameters are now systematically filtered out of error reports for " "certain views (``login``, ``password_reset_confirm``, ``password_change`` " "and ``add_view`` in :mod:`django.contrib.auth.views`, as well as " "``user_change_password`` in the admin app) to prevent the leaking of " "sensitive information such as user passwords." msgstr "" "现在,对于某些视图(``login``、``password_reset_confirm``、" "``password_change`` 和 :mod:`django.contrib.auth.views` 中的 ``add_view``,以" "及管理员应用程序中的 ``user_change_password``),所有 POST 参数都会被系统地从" "错误报告中过滤掉,以防止敏感信息(如用户密码)的泄漏。" msgid "" "You can override or customize the default filtering by writing a :ref:" "`custom filter`. For more information see the docs on :" "ref:`Filtering error reports`." msgstr "" "您可以通过编写 :ref:`自定义过滤器 ` 来覆盖或自定义默认" "的过滤方式。有关更多信息,请参阅 :ref:`过滤错误报告 ` 文档。" msgid "Extended IPv6 support" msgstr "扩展的 IPv6 支持" msgid "" "Django 1.4 can now better handle IPv6 addresses with the new :class:`~django." "db.models.GenericIPAddressField` model field, :class:`~django.forms." "GenericIPAddressField` form field and the validators :data:`~django.core." "validators.validate_ipv46_address` and :data:`~django.core.validators." "validate_ipv6_address`." msgstr "" "Django 1.4 现在可以更好地处理 IPv6 地址,引入了新的 :class:`~django.db." "models.GenericIPAddressField` 模型字段,:class:`~django.forms." "GenericIPAddressField` 表单字段以及验证器 :data:`~django.core.validators." "validate_ipv46_address` 和 :data:`~django.core.validators." "validate_ipv6_address`。" msgid "HTML comparisons in tests" msgstr "测试中的 HTML 比较" msgid "" "The base classes in :mod:`django.test` now have some helpers to compare HTML " "without tripping over irrelevant differences in whitespace, argument quoting/" "ordering and closing of self-closing tags. You can either compare HTML " "directly with the new :meth:`~django.test.SimpleTestCase.assertHTMLEqual` " "and :meth:`~django.test.SimpleTestCase.assertHTMLNotEqual` assertions, or " "use the ``html=True`` flag with :meth:`~django.test.SimpleTestCase." "assertContains` and :meth:`~django.test.SimpleTestCase.assertNotContains` to " "test whether the client's response contains a given HTML fragment. See the :" "ref:`assertions documentation ` for more." msgstr "" "在 :mod:`django.test` 中的基类现在具有一些帮助程序,可以比较 HTML,而不会受到" "不相关的空格差异、参数引用/顺序以及自闭标签的关闭的干扰。您可以使用新的 :" "meth:`~django.test.SimpleTestCase.assertHTMLEqual` 和 :meth:`~django.test." "SimpleTestCase.assertHTMLNotEqual` 断言直接比较 HTML,或者使用 ``html=True`` " "标志与 :meth:`~django.test.SimpleTestCase.assertContains` 和 :meth:`~django." "test.SimpleTestCase.assertNotContains` 来测试客户端的响应是否包含给定的 HTML " "片段。有关更多信息,请参阅 :ref:`断言文档 `。" msgid "Two new date format strings" msgstr "两个新的日期格式字符串" msgid "" "Two new :tfilter:`date` formats were added for use in template filters, " "template tags and :doc:`/topics/i18n/formatting`:" msgstr "" "新增了两个 :tfilter:`date` 格式,可用于模板过滤器、模板标签和 :doc:`/topics/" "i18n/formatting`:" msgid "``e`` -- the name of the timezone of the given datetime object" msgstr "``e`` -- 给定日期时间对象的时区名称" msgid "``o`` -- the ISO 8601 year number" msgstr "``o`` -- ISO 8601 年份编号" msgid "" "Please make sure to update your :ref:`custom format files ` if they contain either ``e`` or ``o`` in a format string. For " "example a Spanish localization format previously only escaped the ``d`` " "format character::" msgstr "" "请确保在您的 :ref:`自定义格式文件 ` 中更新包含格式字符串" "中的 ``e`` 或 ``o`` 的部分。例如,先前的西班牙本地化格式仅对 ``d`` 格式字符进" "行了转义:" msgid "But now it needs to also escape ``e`` and ``o``::" msgstr "但现在它还需要转义 ``e`` 和 ``o``:" msgid "For more information, see the :tfilter:`date` documentation." msgstr "有关更多信息,请参阅 :tfilter:`date` 文档。" msgid "Django 1.4 also includes several smaller improvements worth noting:" msgstr "Django 1.4 还包括一些值得注意的较小改进:" msgid "" "A more usable stacktrace in the technical 500 page. Frames in the stack " "trace that reference Django's framework code are dimmed out, while frames in " "application code are slightly emphasized. This change makes it easier to " "scan a stacktrace for issues in application code." msgstr "" "技术性 500 错误页面中更易用的堆栈跟踪。堆栈跟踪中引用 Django 框架代码的帧会变" "暗,而应用程序代码中的帧会稍微突出。这个改变使得在堆栈跟踪中查找应用程序代码" "的问题变得更容易。" msgid ":doc:`Tablespace support ` in PostgreSQL." msgstr "在 PostgreSQL 中支持 :doc:`表空间 `。" msgid "Customizable names for :meth:`~django.template.Library.simple_tag`." msgstr "可自定义 :meth:`~django.template.Library.simple_tag` 的名称。" msgid "" "In the documentation, a helpful :doc:`security overview ` " "page." msgstr "在文档中,有一个有用的 :doc:`安全概述 ` 页面。" msgid "" "The ``django.contrib.auth.models.check_password`` function has been moved to " "the :mod:`django.contrib.auth.hashers` module. Importing it from the old " "location will still work, but you should update your imports." msgstr "" "``django.contrib.auth.models.check_password`` 函数已移动到 :mod:`django." "contrib.auth.hashers` 模块。从旧位置导入仍然可以工作,但您应该更新您的导入语" "句。" msgid "" "The :djadmin:`collectstatic` management command now has a ``--clear`` option " "to delete all files at the destination before copying or linking the static " "files." msgstr "" "现在,:djadmin:`collectstatic` 管理命令具有一个 ``--clear`` 选项,用于在复制" "或链接静态文件之前删除目标位置的所有文件。" msgid "" "It's now possible to load fixtures containing forward references when using " "MySQL with the InnoDB database engine." msgstr "" "现在可以在使用带有 InnoDB 数据库引擎的 MySQL 时加载包含前向引用的固定数据。" msgid "" "A new 403 response handler has been added as ``'django.views.defaults." "permission_denied'``. You can set your own handler by setting the value of :" "data:`django.conf.urls.handler403`. See the documentation about :ref:`the " "403 (HTTP Forbidden) view` for more information." msgstr "" "新增了一个新的 403 响应处理程序,名称为 ``'django.views.defaults." "permission_denied'``。您可以通过设置 :data:`django.conf.urls.handler403` 的值" "来设置自己的处理程序。有关更多信息,请参阅 :ref:`403 (HTTP Forbidden) 视图 " "` 的文档。" msgid "" "The :djadmin:`makemessages` command uses a new and more accurate lexer, :" "pypi:`JsLex `, for extracting translatable strings from JavaScript " "files." msgstr "" ":djadmin:`makemessages` 命令现在使用一个新的、更准确的词法分析器,:pypi:" "`JsLex `,用于从 JavaScript 文件中提取可翻译的字符串。" msgid "" "The :ttag:`trans` template tag now takes an optional ``as`` argument to be " "able to retrieve a translation string without displaying it but setting a " "template context variable instead." msgstr "" ":ttag:`trans` 模板标签现在接受一个可选的 ``as`` 参数,以便能够检索翻译字符串" "而不显示它,而是设置一个模板上下文变量。" msgid "The :ttag:`if` template tag now supports ``{% elif %}`` clauses." msgstr ":ttag:`if` 模板标签现在支持 ``{% elif %}`` 子句。" msgid "" "If your Django app is behind a proxy, you might find the new :setting:" "`SECURE_PROXY_SSL_HEADER` setting useful. It solves the problem of your " "proxy \"eating\" the fact that a request came in via HTTPS. But only use " "this setting if you know what you're doing." msgstr "" "如果您的 Django 应用程序位于代理之后,您可能会发现新的 :setting:" "`SECURE_PROXY_SSL_HEADER` 设置很有用。它解决了代理将请求通过 HTTPS 进行传递的" "问题。但只有在知道自己在做什么的情况下才使用此设置。" msgid "" "A new, plain-text, version of the HTTP 500 status code internal error page " "served when :setting:`DEBUG` is ``True`` is now sent to the client when " "Django detects that the request has originated in JavaScript code. " "(``is_ajax()`` is used for this.)" msgstr "" "当 :setting:`DEBUG` 为 ``True`` 时,Django 在检测到请求源自 JavaScript 代码" "时,会向客户端发送新的 HTTP 500 状态码内部错误页面的纯文本版本(使用 " "``is_ajax()`` 进行检测)。" msgid "" "Like its HTML counterpart, it contains a collection of different pieces of " "information about the state of the application." msgstr "与其 HTML 对应部分一样,它包含了关于应用程序状态的不同信息片段。" msgid "" "This should make it easier to read when debugging interaction with client-" "side JavaScript." msgstr "这将使得在调试与客户端 JavaScript 交互时更容易阅读。" msgid "Added the :option:`makemessages --no-location` option." msgstr "新增了 :option:`makemessages --no-location` 选项。" msgid "" "Changed the ``locmem`` cache backend to use ``pickle.HIGHEST_PROTOCOL`` for " "better compatibility with the other cache backends." msgstr "" "更改了 ``locmem`` 缓存后端,以使用 ``pickle.HIGHEST_PROTOCOL`` 以提高与其他缓" "存后端的兼容性。" msgid "" "Added support in the ORM for generating ``SELECT`` queries containing " "``DISTINCT ON``." msgstr "在 ORM 中添加了生成包含 ``DISTINCT ON`` 的 ``SELECT`` 查询的支持。" msgid "" "The ``distinct()`` ``QuerySet`` method now accepts an optional list of model " "field names. If specified, then the ``DISTINCT`` statement is limited to " "these fields. This is only supported in PostgreSQL." msgstr "" "``distinct()`` 方法现在接受一个可选的模型字段名称列表。如果指定了这些字段," "则 ``DISTINCT`` 语句将限定在这些字段上。这仅在 PostgreSQL 中支持。" msgid "" "For more details, see the documentation for :meth:`~django.db.models.query." "QuerySet.distinct`." msgstr "" "有关更多详细信息,请参阅 :meth:`~django.db.models.query.QuerySet.distinct` 的" "文档。" msgid "" "The admin login page will add a password reset link if you include a URL " "with the name ``'admin_password_reset'`` in your ``urls.py``, so plugging in " "the built-in password reset mechanism and making it available is now much " "easier. For details, see :ref:`auth_password_reset`." msgstr "" "如果在您的 ``urls.py`` 中包含一个名称为 ``'admin_password_reset'`` 的 URL,管" "理员登录页面将添加一个密码重置链接,因此现在更容易使用内置的密码重置机制并使" "其可用。有关详细信息,请参阅 :ref:`auth_password_reset`。" msgid "" "The MySQL database backend can now make use of the savepoint feature " "implemented by MySQL version 5.0.3 or newer with the InnoDB storage engine." msgstr "" "MySQL 数据库后端现在可以利用 MySQL 5.0.3 或更新版本的 InnoDB 存储引擎实现的保" "存点功能。" msgid "" "It's now possible to pass initial values to the model forms that are part of " "both model formsets and inline model formsets as returned from factory " "functions ``modelformset_factory`` and ``inlineformset_factory`` " "respectively just like with regular formsets. However, initial values only " "apply to extra forms, i.e. those which are not bound to an existing model " "instance." msgstr "" "现在,可以像常规表单集合一样,将初始值传递给模型表单,这些模型表单是从工厂函" "数 ``modelformset_factory`` 和 ``inlineformset_factory`` 返回的,它们分别是模" "型表单集合和内联模型表单集合的一部分。但是,初始值仅适用于额外的表单,即不绑" "定到现有模型实例的表单。" msgid "" "The sitemaps framework can now handle HTTPS links using the new :attr:" "`Sitemap.protocol ` class " "attribute." msgstr "" "现在,站点地图框架可以使用新的 :attr:`Sitemap.protocol ` 类属性处理 HTTPS 链接。" msgid "" "A new :class:`django.test.SimpleTestCase` subclass of :class:`unittest." "TestCase` that's lighter than :class:`django.test.TestCase` and company. It " "can be useful in tests that don't need to hit a database. See :ref:" "`testcase_hierarchy_diagram`." msgstr "" "新增了一个 :class:`django.test.SimpleTestCase`,它是 :class:`unittest." "TestCase` 的子类,比 :class:`django.test.TestCase` 和相关的测试用例更轻量。它" "可以在不需要访问数据库的测试中使用。请参阅 :ref:" "`testcase_hierarchy_diagram`。" msgid "Backwards incompatible changes in 1.4" msgstr "1.4 中的不向后兼容的变更" msgid "SECRET_KEY setting is required" msgstr "SECRET_KEY 设置是必需的" msgid "" "Running Django with an empty or known :setting:`SECRET_KEY` disables many of " "Django's security protections and can lead to remote-code-execution " "vulnerabilities. No Django site should ever be run without a :setting:" "`SECRET_KEY`." msgstr "" "使用空或已知的 :setting:`SECRET_KEY` 运行 Django 会禁用许多 Django 的安全保护" "功能,并可能导致远程代码执行漏洞。任何 Django 站点都不应该在没有 :setting:" "`SECRET_KEY` 的情况下运行。" msgid "" "In Django 1.4, starting Django with an empty :setting:`SECRET_KEY` will " "raise a ``DeprecationWarning``. In Django 1.5, it will raise an exception " "and Django will refuse to start. This is slightly accelerated from the usual " "deprecation path due to the severity of the consequences of running Django " "with no :setting:`SECRET_KEY`." msgstr "" "在 Django 1.4 中,使用空的 :setting:`SECRET_KEY` 启动 Django 会引发 " "``DeprecationWarning``。在 Django 1.5 中,它将引发异常,并且 Django 将拒绝启" "动。这是因为在没有 :setting:`SECRET_KEY` 的情况下运行 Django 会导致严重后果," "所以这个过程略有加速。" msgid "``django.contrib.admin``" msgstr "``django.contrib.admin``" msgid "" "The included administration app ``django.contrib.admin`` has for a long time " "shipped with a default set of static files such as JavaScript, images and " "stylesheets. Django 1.3 added a new contrib app ``django.contrib." "staticfiles`` to handle such files in a generic way and defined conventions " "for static files included in apps." msgstr "" "包含的管理应用程序 ``django.contrib.admin`` 长期以来都包含了一组默认的静态文" "件,如 JavaScript、图像和样式表。Django 1.3 添加了一个新的 contrib 应用程序 " "``django.contrib.staticfiles``,以一种通用的方式处理这些文件,并定义了应用程" "序中包含的静态文件的约定。" msgid "" "Starting in Django 1.4, the admin's static files also follow this " "convention, to make the files easier to deploy. In previous versions of " "Django, it was also common to define an ``ADMIN_MEDIA_PREFIX`` setting to " "point to the URL where the admin's static files live on a web server. This " "setting has now been deprecated and replaced by the more general setting :" "setting:`STATIC_URL`. Django will now expect to find the admin static files " "under the URL ``/admin/``." msgstr "" "从 Django 1.4 开始,管理界面的静态文件也遵循这个约定,以使文件更容易部署。在 " "Django 的早期版本中,通常会定义一个 ``ADMIN_MEDIA_PREFIX`` 设置,指向 web 服" "务器上管理界面的静态文件所在的 URL。现在,这个设置已被弃用,并由更通用的设" "置 :setting:`STATIC_URL` 取代。Django 现在期望在 URL ``/admin/`` " "下找到管理界面的静态文件。" msgid "" "If you've previously used a URL path for ``ADMIN_MEDIA_PREFIX`` (e.g. ``/" "media/``) simply make sure :setting:`STATIC_URL` and :setting:`STATIC_ROOT` " "are configured and your web server serves those files correctly. The " "development server continues to serve the admin files just like before. Read " "the :doc:`static files howto ` for more details." msgstr "" "如果您之前使用了 ``ADMIN_MEDIA_PREFIX`` 的 URL 路径(例如 ``/media/``),只需" "确保 :setting:`STATIC_URL` 和 :setting:`STATIC_ROOT` 配置正确,并且您的 Web " "服务器能够正确提供这些文件。开发服务器仍然像以前一样提供管理界面的文件。阅" "读 :doc:`静态文件 howto ` 以获取更多详细信息。" msgid "" "If your ``ADMIN_MEDIA_PREFIX`` is set to a specific domain (e.g. ``http://" "media.example.com/admin/``), make sure to also set your :setting:" "`STATIC_URL` setting to the correct URL -- for example, ``http://media." "example.com/``." msgstr "" "如果您的 ``ADMIN_MEDIA_PREFIX`` 设置为特定的域名(例如 ``http://media." "example.com/admin/``),请确保将您的 :setting:`STATIC_URL` 设置为正确的 URL," "例如 ``http://media.example.com/``。" msgid "" "If you're implicitly relying on the path of the admin static files within " "Django's source code, you'll need to update that path. The files were moved " "from :file:`django/contrib/admin/media/` to :file:`django/contrib/admin/" "static/admin/`." msgstr "" "如果您隐式依赖于 Django 源代码中管理界面静态文件的路径,您需要更新该路径。这" "些文件已从 :file:`django/contrib/admin/media/` 移动到 :file:`django/contrib/" "admin/static/admin/`。" msgid "Supported browsers for the admin" msgstr "管理支持的浏览器" msgid "" "Django hasn't had a clear policy on which browsers are supported by the " "admin app. Our new policy formalizes existing practices: `YUI's A-grade`_ " "browsers should provide a fully-functional admin experience, with the " "notable exception of Internet Explorer 6, which is no longer supported." msgstr "" "Django 对于管理界面应用程序支持哪些浏览器一直没有明确的政策。我们的新政策正式" "规范了现有的做法:`YUI 的 A 级`_ 浏览器应提供完整功能的管理界面体验,但不再支" "持 Internet Explorer 6,这是一个显著的例外。" msgid "" "Released over 10 years ago, IE6 imposes many limitations on modern web " "development. The practical implications of this policy are that contributors " "are free to improve the admin without consideration for these limitations." msgstr "" "IE6 发布于 10 多年前,给现代 Web 开发带来了许多限制。这项政策的实际影响是,贡" "献者可以在不考虑这些限制的情况下自由地改进管理员界面。" msgid "" "This new policy **has no impact** on sites you develop using Django. It only " "applies to the Django admin. Feel free to develop apps compatible with any " "range of browsers." msgstr "" "这个新政策 **不会影响** 使用 Django 开发的网站。它仅适用于 Django 管理界面。" "请随意开发与各种浏览器兼容的应用程序。" msgid "Removed admin icons" msgstr "移除了管理图标" msgid "" "As part of an effort to improve the performance and usability of the admin's " "change-list sorting interface and :attr:`horizontal ` and :attr:`vertical ` \"filter\" widgets, some icon files were " "removed and grouped into two sprite files." msgstr "" "为了改善管理界面的列表排序界面和 :attr:`horizontal ` 和 :attr:`vertical ` \"filter\" 小部件的性能和可用性,一些图标文件已" "被删除并组合到两个精灵文件中。" msgid "" "Specifically: ``selector-add.gif``, ``selector-addall.gif``, ``selector-" "remove.gif``, ``selector-removeall.gif``, ``selector_stacked-add.gif`` and " "``selector_stacked-remove.gif`` were combined into ``selector-icons.gif``; " "and ``arrow-up.gif`` and ``arrow-down.gif`` were combined into ``sorting-" "icons.gif``." msgstr "" "具体来说:``selector-add.gif``, ``selector-addall.gif``, ``selector-remove." "gif``, ``selector-removeall.gif``, ``selector_stacked-add.gif`` 和 " "``selector_stacked-remove.gif`` 已合并到 ``selector-icons.gif`` 中;``arrow-" "up.gif`` 和 ``arrow-down.gif`` 已合并到 ``sorting-icons.gif`` 中。" msgid "" "If you used those icons to customize the admin, then you'll need to replace " "them with your own icons or get the files from a previous release." msgstr "" "如果您使用这些图标来自定义管理员界面,那么您需要用自己的图标替换它们,或者从" "以前的版本中获取这些文件。" msgid "CSS class names in admin forms" msgstr "管理员表单中的 CSS 类名" msgid "" "To avoid conflicts with other common CSS class names (e.g. \"button\"), we " "added a prefix (\"field-\") to all CSS class names automatically generated " "from the form field names in the main admin forms, stacked inline forms and " "tabular inline cells. You'll need to take that prefix into account in your " "custom style sheets or JavaScript files if you previously used plain field " "names as selectors for custom styles or JavaScript transformations." msgstr "" "为避免与其他常见 CSS 类名(例如 \"button\")发生冲突,我们为主管理员表单、堆" "叠内联表单和表格内联单元格中的表单字段名自动生成的所有 CSS 类名添加了一个前缀" "(\"field-\")。如果您之前使用普通字段名作为自定义样式或 JavaScript 转换的选" "择器,您需要在自定义样式表或 JavaScript 文件中考虑到这个前缀。" msgid "Compatibility with old signed data" msgstr "与旧版签名数据的兼容性" msgid "" "Django 1.3 changed the cryptographic signing mechanisms used in a number of " "places in Django. While Django 1.3 kept fallbacks that would accept hashes " "produced by the previous methods, these fallbacks are removed in Django 1.4." msgstr "" "Django 1.3 更改了 Django 中多个地方使用的加密签名机制。尽管 Django 1.3 保留了" "接受由之前方法生成的哈希值的回退机制,但这些回退机制在 Django 1.4 中已被移" "除。" msgid "" "So, if you upgrade to Django 1.4 directly from 1.2 or earlier, you may lose/" "invalidate certain pieces of data that have been cryptographically signed " "using an old method. To avoid this, use Django 1.3 first for a period of " "time to allow the signed data to expire naturally. The affected parts are " "detailed below, with 1) the consequences of ignoring this advice and 2) the " "amount of time you need to run Django 1.3 for the data to expire or become " "irrelevant." msgstr "" "因此,如果您直接从 1.2 或更早版本升级到 Django 1.4,您可能会丢失/使使用旧方法" "加密签名的某些数据失效。为避免这种情况,请先使用 Django 1.3 一段时间,以便让" "签名数据自然过期。受影响的部分详细说明如下: 1 ) 忽略此建议的后果; 2 ) 为使" "数据过期或变得无关紧要,您需要运行 Django 1.3 的时间。" msgid "``contrib.sessions`` data integrity check" msgstr "``contrib.sessions`` 数据完整性检查" msgid "" "Consequences: The user will be logged out, and session data will be lost." msgstr "后果:用户将被登出,且会话数据将丢失。" msgid "Time period: Defined by :setting:`SESSION_COOKIE_AGE`." msgstr "时间段:由 :setting:`SESSION_COOKIE_AGE` 定义。" msgid "``contrib.auth`` password reset hash" msgstr "``contrib.auth`` 密码重置哈希" msgid "" "Consequences: Password reset links from before the upgrade will not work." msgstr "后果:升级前的密码重置链接将无法使用。" msgid "Time period: Defined by ``PASSWORD_RESET_TIMEOUT_DAYS``." msgstr "时间段:由 ``PASSWORD_RESET_TIMEOUT_DAYS`` 定义。" msgid "" "Form-related hashes: these have a much shorter lifetime and are relevant " "only for the short window where a user might fill in a form generated by the " "pre-upgrade Django instance and try to submit it to the upgraded Django " "instance:" msgstr "" "与表单相关的哈希:它们的生命周期要短得多,仅与用户可能填写由升级前的 Django " "实例生成的表单并尝试将其提交到升级后的 Django 实例的短暂窗口期相关。" msgid "``contrib.comments`` form security hash" msgstr "``contrib.comments`` 表单安全哈希" msgid "" "Consequences: The user will see the validation error \"Security hash failed." "\"" msgstr "后果:用户将看到验证错误 \"安全哈希失败。\"" msgid "" "Time period: The amount of time you expect users to take filling out comment " "forms." msgstr "时间周期:您预期用户填写评论表单所需的时间。" msgid "``FormWizard`` security hash" msgstr "``FormWizard`` 安全哈希" msgid "" "Consequences: The user will see an error about the form having expired and " "will be sent back to the first page of the wizard, losing the data entered " "so far." msgstr "" "后果:用户将看到关于表单已过期的错误,并被退回到向导的第一页,迄今为止输入的" "数据将丢失。" msgid "" "Time period: The amount of time you expect users to take filling out the " "affected forms." msgstr "时间周期:您预期用户填写受影响表单所需的时间。" msgid "CSRF check" msgstr "CSRF 检查" msgid "" "Note: This is actually a Django 1.1 fallback, not Django 1.2, and it applies " "only if you're upgrading from 1.1." msgstr "" "注意:这实际上是一个从 Django 1.1 回退,而不是 Django 1.2,仅在您从 1.1 升级" "时适用。" msgid "" "Consequences: The user will see a 403 error with any CSRF-protected POST " "form." msgstr "后果:用户在任何受 CSRF 保护的 POST 表单中都会看到 403 错误。" msgid "" "Time period: The amount of time you expect user to take filling out such " "forms." msgstr "时间周期:您预期用户填写此类表单所需的时间。" msgid "``contrib.auth`` user password hash-upgrade sequence" msgstr "``contrib.auth`` 用户密码升级哈希序列" msgid "" "Consequences: Each user's password will be updated to a stronger password " "hash when it's written to the database in 1.4. This means that if you " "upgrade to 1.4 and then need to downgrade to 1.3, version 1.3 won't be able " "to read the updated passwords." msgstr "" "后果:在 1.4 版本中,每个用户的密码将在写入数据库时更新为更强的密码散列。这意" "味着如果您升级到 1.4 然后需要降级到 1.3,1.3 版本将无法读取更新后的密码。" msgid "" "Remedy: Set :setting:`PASSWORD_HASHERS` to use your original password " "hashing when you initially upgrade to 1.4. After you confirm your app works " "well with Django 1.4 and you won't have to roll back to 1.3, enable the new " "password hashes." msgstr "" "解决方法:在初始升级到 1.4 时将 :setting:`PASSWORD_HASHERS` 设置为使用您原始" "的密码哈希方式。确认您的应用在 Django 1.4 上运行良好且不需要回滚到 1.3 后,启" "用新的密码哈希方式。" msgid "``django.contrib.flatpages``" msgstr "``django.contrib.flatpages``" msgid "" "Starting in 1.4, the :class:`~django.contrib.flatpages.middleware." "FlatpageFallbackMiddleware` only adds a trailing slash and redirects if the " "resulting URL refers to an existing flatpage. For example, requesting ``/" "notaflatpageoravalidurl`` in a previous version would redirect to ``/" "notaflatpageoravalidurl/``, which would subsequently raise a 404. Requesting " "``/notaflatpageoravalidurl`` now will immediately raise a 404." msgstr "" "从 1.4 版本开始,:class:`~django.contrib.flatpages.middleware." "FlatpageFallbackMiddleware` 仅在生成的 URL 引用现有的平面页面时才会添加尾随斜" "杠并重定向。例如,在以前的版本中,请求 ``/notaflatpageoravalidurl`` 会重定向" "到 ``/notaflatpageoravalidurl/``,然后会引发 404 错误。现在请求 ``/" "notaflatpageoravalidurl`` 将立即引发 404 错误。" msgid "" "Also, redirects returned by flatpages are now permanent (with 301 status " "code), to match the behavior of :class:`~django.middleware.common." "CommonMiddleware`." msgstr "" "此外,平面页面返回的重定向现在是永久性的(使用 301 状态代码),以与 :class:" "`~django.middleware.common.CommonMiddleware` 的行为一致。" msgid "" "Serialization of :class:`~datetime.datetime` and :class:`~datetime.time`" msgstr ":class:`~datetime.datetime` 和 :class:`~datetime.time` 的序列化" msgid "" "As a consequence of time-zone support, and according to the ECMA-262 " "specification, we made changes to the JSON serializer:" msgstr "" "作为时区支持的结果,并根据 ECMA-262 规范,我们对 JSON 序列化器进行了更改:" msgid "" "It includes the time zone for aware datetime objects. It raises an exception " "for aware time objects." msgstr "" "它包括了具有时区感知的 datetime 对象的时区。对于具有时区感知的 time 对象,它" "会引发一个异常。" msgid "" "It includes milliseconds for datetime and time objects. There is still some " "precision loss, because Python stores microseconds (6 digits) and JSON only " "supports milliseconds (3 digits). However, it's better than discarding " "microseconds entirely." msgstr "" "它包括了 datetime 和 time 对象的毫秒数。由于 Python 存储微秒(6 位数字)而 " "JSON 仅支持毫秒(3 位数字),因此仍然存在一些精度损失。然而,这总比完全丢弃微" "秒要好。" msgid "" "We changed the XML serializer to use the ISO8601 format for datetimes. The " "letter ``T`` is used to separate the date part from the time part, instead " "of a space. Time zone information is included in the ``[+-]HH:MM`` format." msgstr "" "我们更改了 XML 序列化器以使用 ISO8601 格式来表示日期时间。使用字母 ``T`` 来分" "隔日期部分和时间部分,而不是使用空格。时区信息以 ``[+-]HH:MM`` 格式包含在内。" msgid "" "Though the serializers now use these new formats when creating fixtures, " "they can still load fixtures that use the old format." msgstr "" "尽管序列化器在创建固件时现在使用这些新格式,但它们仍然可以加载使用旧格式的固" "件。" msgid "``supports_timezone`` changed to ``False`` for SQLite" msgstr "``supports_timezone`` 对于 SQLite 现在更改为 ``False``。" msgid "" "The database feature ``supports_timezone`` used to be ``True`` for SQLite. " "Indeed, if you saved an aware datetime object, SQLite stored a string that " "included an UTC offset. However, this offset was ignored when loading the " "value back from the database, which could corrupt the data." msgstr "" "数据库特性 ``supports_timezone`` 以前对于 SQLite 是 ``True``。确实,如果您保" "存了一个带有时区信息的 datetime 对象,SQLite 会存储一个包含 UTC 偏移的字符" "串。然而,在从数据库加载值时会忽略此偏移量,这可能会导致数据损坏。" msgid "" "In the context of time-zone support, this flag was changed to ``False``, and " "datetimes are now stored without time-zone information in SQLite. When :" "setting:`USE_TZ` is ``False``, if you attempt to save an aware datetime " "object, Django raises an exception." msgstr "" "在时区支持的背景下,此标志已更改为 ``False``,并且在 SQLite 中现在以不带时区" "信息的方式存储日期时间。当 :setting:`USE_TZ` 为 ``False`` 时,如果尝试保存一" "个带有时区信息的 datetime 对象,Django 将引发异常。" msgid "``MySQLdb``-specific exceptions" msgstr "``MySQLdb`` 特定的异常" msgid "" "The MySQL backend historically has raised ``MySQLdb.OperationalError`` when " "a query triggered an exception. We've fixed this bug, and we now raise :exc:" "`django.db.DatabaseError` instead. If you were testing for ``MySQLdb." "OperationalError``, you'll need to update your ``except`` clauses." msgstr "" "MySQL 后端在历史上在查询触发异常时引发了 ``MySQLdb.OperationalError``。我们已" "经修复了这个 bug,现在我们会引发 :exc:`django.db.DatabaseError`。如果您在测试" "时使用了 ``MySQLdb.OperationalError``,您需要更新您的 ``except`` 子句。" msgid "Database connection's thread-locality" msgstr "数据库连接的线程局部性" msgid "" "``DatabaseWrapper`` objects (i.e. the connection objects referenced by " "``django.db.connection`` and ``django.db.connections[\"some_alias\"]``) used " "to be thread-local. They are now global objects in order to be potentially " "shared between multiple threads. While the individual connection objects are " "now global, the ``django.db.connections`` dictionary referencing those " "objects is still thread-local. Therefore if you just use the ORM or " "``DatabaseWrapper.cursor()`` then the behavior is still the same as before. " "Note, however, that ``django.db.connection`` does not directly reference the " "default ``DatabaseWrapper`` object anymore and is now a proxy to access that " "object's attributes. If you need to access the actual ``DatabaseWrapper`` " "object, use ``django.db.connections[DEFAULT_DB_ALIAS]`` instead." msgstr "" "``DatabaseWrapper`` 对象(即由 ``django.db.connection`` 和 ``django.db." "connections[\"some_alias\"]`` 引用的连接对象)以前是线程局部的。现在它们是全" "局对象,可以在多个线程之间共享。尽管单个连接对象现在是全局的,但引用这些对象" "的 ``django.db.connections`` 字典仍然是线程局部的。因此,如果您只是使用 ORM " "或 ``DatabaseWrapper.cursor()``,那么行为仍然与以前相同。但请注意,``django." "db.connection`` 现在不再直接引用默认的 ``DatabaseWrapper`` 对象,而是代理访问" "该对象的属性。如果您需要访问实际的 ``DatabaseWrapper`` 对象,请改用 ``django." "db.connections[DEFAULT_DB_ALIAS]``。" msgid "" "As part of this change, all underlying SQLite connections are now enabled " "for potential thread-sharing (by passing the ``check_same_thread=False`` " "attribute to ``pysqlite``). ``DatabaseWrapper`` however preserves the " "previous behavior by disabling thread-sharing by default, so this does not " "affect any existing code that purely relies on the ORM or on " "``DatabaseWrapper.cursor()``." msgstr "" "作为这个改变的一部分,现在所有底层的 SQLite 连接都已经启用了潜在的线程共享" "(通过将 ``check_same_thread=False`` 属性传递给 ``pysqlite``)。然而," "``DatabaseWrapper`` 默认情况下仍然保留以前的行为,通过禁用线程共享,因此这不" "会影响任何纯粹依赖 ORM 或 ``DatabaseWrapper.cursor()`` 的现有代码。" msgid "" "Finally, while it's now possible to pass connections between threads, Django " "doesn't make any effort to synchronize access to the underlying backend. " "Concurrency behavior is defined by the underlying backend implementation. " "Check their documentation for details." msgstr "" "最后,尽管现在可以在线程之间传递连接,但 Django 并未尝试同步访问底层后端。并" "发行为由底层后端实现定义。请查阅它们的文档以获取详细信息。" msgid "``COMMENTS_BANNED_USERS_GROUP`` setting" msgstr "``COMMENTS_BANNED_USERS_GROUP`` 配置" msgid "" "Django's comments has historically supported excluding the comments of a " "special user group, but we've never documented the feature properly and " "didn't enforce the exclusion in other parts of the app such as the template " "tags. To fix this problem, we removed the code from the feed class." msgstr "" "Django 的评论历史上支持排除特殊用户组的评论,但我们从未正确记录此功能,并且没" "有在应用程序的其他部分(如模板标签)中执行排除。为了解决这个问题,我们从 " "feed 类中删除了代码。" msgid "" "If you rely on the feature and want to restore the old behavior, use a " "custom comment model manager to exclude the user group, like this::" msgstr "" "如果您依赖此功能并希望恢复旧的行为,可以使用自定义评论模型管理器来排除用户" "组,如下所示:" msgid "" "Save this model manager in your custom comment app (e.g., in " "``my_comments_app/managers.py``) and add it your custom comment app model::" msgstr "" "请将此模型管理器保存在您的自定义评论应用中(例如,在 ``my_comments_app/" "managers.py`` 中),然后将其添加到您的自定义评论应用模型中:" msgid "``IGNORABLE_404_STARTS`` and ``IGNORABLE_404_ENDS`` settings" msgstr "``IGNORABLE_404_STARTS`` 和 ``IGNORABLE_404_ENDS`` 配置" msgid "" "Until Django 1.3, it was possible to exclude some URLs from Django's :doc:" "`404 error reporting` by adding prefixes to " "``IGNORABLE_404_STARTS`` and suffixes to ``IGNORABLE_404_ENDS``." msgstr "" "在 Django 1.3 之前,可以通过在 ``IGNORABLE_404_STARTS`` 添加前缀和在 " "``IGNORABLE_404_ENDS`` 添加后缀来将某些 URL 排除在 Django 的 :doc:`404 错误报" "告 ` 之外。" msgid "" "In Django 1.4, these two settings are superseded by :setting:" "`IGNORABLE_404_URLS`, which is a list of compiled regular expressions. " "Django won't send an email for 404 errors on URLs that match any of them." msgstr "" "在 Django 1.4 中,这两个设置被 :setting:`IGNORABLE_404_URLS` 取代,它是一个编" "译后的正则表达式列表。Django 不会为匹配其中任何一个的 URL 的 404 错误发送电子" "邮件。" msgid "" "Furthermore, the previous settings had some rather arbitrary default values::" msgstr "此外,以前的设置具有一些相当任意的默认值:" msgid "" "It's not Django's role to decide if your website has a legacy ``/cgi-bin/`` " "section or a ``favicon.ico``. As a consequence, the default values of :" "setting:`IGNORABLE_404_URLS`, ``IGNORABLE_404_STARTS``, and " "``IGNORABLE_404_ENDS`` are all now empty." msgstr "" "Django 不负责决定您的网站是否有一个遗留的 ``/cgi-bin/`` 部分或一个 ``favicon." "ico``。因此,:setting:`IGNORABLE_404_URLS`、``IGNORABLE_404_STARTS`` 和 " "``IGNORABLE_404_ENDS`` 的默认值现在都为空。" msgid "" "If you have customized ``IGNORABLE_404_STARTS`` or ``IGNORABLE_404_ENDS``, " "or if you want to keep the old default value, you should add the following " "lines in your settings file::" msgstr "" "如果您已经定制了 ``IGNORABLE_404_STARTS`` 或 ``IGNORABLE_404_ENDS``,或者希望" "保留旧的默认值,您应该在您的设置文件中添加以下行:" msgid "" "Don't forget to escape characters that have a special meaning in a regular " "expression, such as periods." msgstr "不要忘记转义在正则表达式中具有特殊含义的字符,例如句点。" msgid "CSRF protection extended to PUT and DELETE" msgstr "CSRF 保护扩展到 PUT 和 DELETE 操作" msgid "" "Previously, Django's :doc:`CSRF protection ` provided protection " "only against POST requests. Since use of PUT and DELETE methods in AJAX " "applications is becoming more common, we now protect all methods not defined " "as safe by :rfc:`2616` -- i.e., we exempt GET, HEAD, OPTIONS and TRACE, and " "we enforce protection on everything else." msgstr "" "以前,Django 的 :doc:`CSRF 保护 ` 仅对 POST 请求提供保护。由于在 " "AJAX 应用中使用 PUT 和 DELETE 方法变得越来越常见,因此现在我们对所有未被 :" "rfc:`2616` 定义为安全的方法提供保护 — 即,我们排除了 GET、HEAD、OPTIONS 和 " "TRACE,对其他一切进行保护。" msgid "" "If you're using PUT or DELETE methods in AJAX applications, please see the :" "ref:`instructions about using AJAX and CSRF `." msgstr "" "如果您在 AJAX 应用中使用 PUT 或 DELETE 方法,请参阅有关使用 AJAX 和 CSRF 的 :" "ref:`说明 `。" msgid "Password reset view now accepts ``subject_template_name``" msgstr "密码重置视图现在接受 ``subject_template_name``" msgid "" "The ``password_reset`` view in ``django.contrib.auth`` now accepts a " "``subject_template_name`` parameter, which is passed to the password save " "form as a keyword argument. If you are using this view with a custom " "password reset form, then you will need to ensure your form's ``save()`` " "method accepts this keyword argument." msgstr "" "``django.contrib.auth`` 中的 ``password_reset`` 视图现在接受一个 " "``subject_template_name`` 参数,该参数作为关键字参数传递给密码保存表单。如果" "您正在使用自定义密码重置表单与此视图一起使用,那么您需要确保您的表单的 " "``save()`` 方法接受此关键字参数。" msgid "``django.core.template_loaders``" msgstr "``django.core.template_loaders``" msgid "" "This was an alias to ``django.template.loader`` since 2005, and we've " "removed it without emitting a warning due to the length of the deprecation. " "If your code still referenced this, please use ``django.template.loader`` " "instead." msgstr "" "自 2005 年以来,这是对 ``django.template.loader`` 的别名,由于过长的弃用期," "我们已将其删除而不发出警告。如果您的代码仍然引用了它,请改用 ``django." "template.loader``。" msgid "``django.db.models.fields.URLField.verify_exists``" msgstr "``django.db.models.fields.URLField.verify_exists``" msgid "" "This functionality has been removed due to intractable performance and " "security issues. Any existing usage of ``verify_exists`` should be removed." msgstr "" "由于无法解决的性能和安全问题,已删除了此功能。应删除任何现有的 " "``verify_exists`` 用法。" msgid "``django.core.files.storage.Storage.open``" msgstr "``django.core.files.storage.Storage.open``" msgid "" "The ``open`` method of the base Storage class used to take an obscure " "parameter ``mixin`` that allowed you to dynamically change the base classes " "of the returned file object. This has been removed. In the rare case you " "relied on the ``mixin`` parameter, you can easily achieve the same by " "overriding the ``open`` method, like this::" msgstr "" "基本 Storage 类的 ``open`` 方法曾经接受一个晦涩的参数 ``mixin``,允许您动态更" "改返回的文件对象的基类。这已被移除。在极少数情况下,如果您依赖于 ``mixin`` 参" "数,您可以通过覆盖 ``open`` 方法轻松实现相同的效果,如下所示:" msgid "YAML deserializer now uses ``yaml.safe_load``" msgstr "YAML 反序列化器现在使用 ``yaml.safe_load``" msgid "" "``yaml.load`` is able to construct any Python object, which may trigger " "arbitrary code execution if you process a YAML document that comes from an " "untrusted source. This feature isn't necessary for Django's YAML " "deserializer, whose primary use is to load fixtures consisting of simple " "objects. Even though fixtures are trusted data, the YAML deserializer now " "uses ``yaml.safe_load`` for additional security." msgstr "" "``yaml.load`` 能够构造任何 Python 对象,如果处理来自不受信任的源的 YAML 文" "档,可能触发任意代码执行。这个特性对于 Django 的 YAML 反序列化器并不必要,因" "为它的主要用途是加载由简单对象组成的 fixture。尽管 fixture 是可信数据,但 " "YAML 反序列化器现在使用 ``yaml.safe_load`` 来提供额外的安全性。" msgid "Session cookies now have the ``httponly`` flag by default" msgstr "会话 cookie 现在默认情况下具有 ``httponly`` 标志" msgid "" "Session cookies now include the ``httponly`` attribute by default to help " "reduce the impact of potential XSS attacks. As a consequence of this change, " "session cookie data, including ``sessionid``, is no longer accessible from " "JavaScript in many browsers. For strict backwards compatibility, use " "``SESSION_COOKIE_HTTPONLY = False`` in your settings file." msgstr "" "为了减少潜在的 XSS 攻击影响,会话 cookie 现在默认包含 ``httponly`` 属性。由于" "这个改变,许多浏览器中的 JavaScript 不再可以访问会话 cookie 数据,包括 " "``sessionid``。为了严格的向后兼容性,在您的设置文件中使用 " "``SESSION_COOKIE_HTTPONLY = False``。" msgid "The :tfilter:`urlize` filter no longer escapes every URL" msgstr ":tfilter:`urlize` 过滤器不再对每个 URL 进行转义" msgid "" "When a URL contains a ``%xx`` sequence, where ``xx`` are two hexadecimal " "digits, :tfilter:`urlize` now assumes that the URL is already escaped and " "doesn't apply URL escaping again. This is wrong for URLs whose unquoted form " "contains a ``%xx`` sequence, but such URLs are very unlikely to happen in " "the wild, because they would confuse browsers too." msgstr "" "当一个 URL 包含一个 ``%xx`` 序列,其中 ``xx`` 是两个十六进制数字时,:tfilter:" "`urlize` 现在假定该 URL 已经被转义,不会再次应用 URL 转义。这对于其未引用形式" "包含 ``%xx`` 序列的 URL 是不正确的,但这种情况在实际使用中非常罕见,因为它们" "也会混淆浏览器。" msgid "``assertTemplateUsed`` and ``assertTemplateNotUsed`` as context manager" msgstr "" "``assertTemplateUsed`` 和 ``assertTemplateNotUsed`` 现在作为上下文管理器可用" msgid "" "It's now possible to check whether a template was used within a block of " "code with :meth:`~django.test.SimpleTestCase.assertTemplateUsed` and :meth:" "`~django.test.SimpleTestCase.assertTemplateNotUsed`. And they can be used as " "a context manager::" msgstr "" "现在可以使用 :meth:`~django.test.SimpleTestCase.assertTemplateUsed` 和 :meth:" "`~django.test.SimpleTestCase.assertTemplateNotUsed` 来检查模板是否在代码块中" "被使用,并且它们可以作为上下文管理器使用:" msgid "See the :ref:`assertion documentation` for more." msgstr "更多信息请查看 :ref:`断言文档 `。" msgid "Database connections after running the test suite" msgstr "运行测试套件后的数据库连接" msgid "" "The default test runner no longer restores the database connections after " "tests' execution. This prevents the production database from being exposed " "to potential threads that would still be running and attempting to create " "new connections." msgstr "" "默认的测试运行器在测试执行后不再恢复数据库连接。这可以防止生产数据库暴露给可" "能仍在运行并尝试创建新连接的潜在线程。" msgid "" "If your code relied on connections to the production database being created " "after tests' execution, then you can restore the previous behavior by " "subclassing ``DjangoTestRunner`` and overriding its ``teardown_databases()`` " "method." msgstr "" "如果您的代码依赖于在测试执行后创建到生产数据库的连接,那么您可以通过子类化 " "``DjangoTestRunner`` 并重写其 ``teardown_databases()`` 方法来恢复以前的行为。" msgid "Output of :djadmin:`manage.py help `" msgstr ":djadmin:`manage.py help ` 的输出" msgid "" ":djadmin:`manage.py help ` now groups available commands by " "application. If you depended on the output of this command -- if you parsed " "it, for example -- then you'll need to update your code. To get a list of " "all available management commands in a script, use :djadmin:`manage.py help " "--commands ` instead." msgstr "" ":djadmin:`manage.py help ` 现在按应用程序分组列出可用命令。如果你依赖于" "此命令的输出,例如进行解析,那么你需要更新你的代码。要在脚本中获取所有可用管" "理命令的列表,请改用 :djadmin:`manage.py help --commands `。" msgid "``extends`` template tag" msgstr "``extends`` 模板标签" msgid "" "Previously, the :ttag:`extends` tag used a buggy method of parsing " "arguments, which could lead to it erroneously considering an argument as a " "string literal when it wasn't. It now uses ``parser.compile_filter``, like " "other tags." msgstr "" "以前,:ttag:`extends` 标签使用了一种有缺陷的参数解析方法,这可能会导致它错误" "地将一个参数视为字符串文字,当它实际上不是字符串文字时。现在它使用 ``parser." "compile_filter``,与其他标签类似。" msgid "" "The internals of the tag aren't part of the official stable API, but in the " "interests of full disclosure, the ``ExtendsNode.__init__`` definition has " "changed, which may break any custom tags that use this class." msgstr "" "标签的内部不是官方稳定 API 的一部分,但为了充分披露,``ExtendsNode." "__init__`` 的定义已更改,这可能会破坏使用此类的自定义标签。" msgid "Loading some incomplete fixtures no longer works" msgstr "加载某些不完整的固件将不再工作" msgid "" "Prior to 1.4, a default value was inserted for fixture objects that were " "missing a specific date or datetime value when auto_now or auto_now_add was " "set for the field. This was something that should not have worked, and in " "1.4 loading such incomplete fixtures will fail. Because fixtures are a raw " "import, they should explicitly specify all field values, regardless of field " "options on the model." msgstr "" "在 1.4 之前,当字段设置了 auto _ now 或 auto _ now _ add 时,如果固件对象缺少" "特定的日期或日期时间值,则会插入一个默认值。这是本不应该工作的,而在 1.4 中," "加载这样的不完整固件将会失败。因为固件是原始导入,所以它们应该明确指定所有字" "段值,而不考虑模型上的字段选项。" msgid "Development Server Multithreading" msgstr "开发服务器多线程" msgid "" "The development server is now is multithreaded by default. Use the :option:" "`runserver --nothreading` option to disable the use of threading in the " "development server:" msgstr "" "开发服务器现在默认为多线程模式。使用 :option:`runserver --nothreading` 选项来" "禁用开发服务器中的多线程。" msgid "Attributes disabled in markdown when safe mode set" msgstr "在设置安全模式时,markdown 中的属性被禁用" msgid "" "Prior to Django 1.4, attributes were included in any markdown output " "regardless of safe mode setting of the filter. With version > 2.1 of the " "Python-Markdown library, an enable_attributes option was added. When the " "safe argument is passed to the markdown filter, both the ``safe_mode=True`` " "and ``enable_attributes=False`` options are set. If using a version of the " "Python-Markdown library less than 2.1, a warning is issued that the output " "is insecure." msgstr "" "在 Django 1.4 之前,无论过滤器的 safe 模式设置如何,属性都会包含在任何 " "markdown 输出中。在 Python-Markdown 库的版本 > 2.1 中,添加了一个 " "enable_attributes 选项。如果将 safe 参数传递给 markdown 过滤器,则同时设置 " "``safe_mode=True`` 和 ``enable_attributes=False`` 选项。如果使用的是 Python-" "Markdown 库的版本小于 2.1,则会发出一个警告,指出输出不安全。" msgid "FormMixin get_initial returns an instance-specific dictionary" msgstr "FormMixin 的 get_initial 返回特定实例的字典" msgid "" "In Django 1.3, the ``get_initial`` method of the :class:`django.views." "generic.edit.FormMixin` class was returning the class ``initial`` " "dictionary. This has been fixed to return a copy of this dictionary, so form " "instances can modify their initial data without messing with the class " "variable." msgstr "" "在 Django 1.3 中,:class:`django.views.generic.edit.FormMixin` 类的 " "``get_initial`` 方法返回了类变量 ``initial`` 字典。现在已修复为返回该字典的副" "本,因此表单实例可以修改其初始数据,而不会影响类变量。" msgid "Features deprecated in 1.4" msgstr "在 1.4 中被废弃的功能" msgid "Old styles of calling ``cache_page`` decorator" msgstr "调用 ``cache_page`` 装饰器的旧样式是:" msgid "" "Some legacy ways of calling :func:`~django.views.decorators.cache." "cache_page` have been deprecated. Please see the documentation for the " "correct way to use this decorator." msgstr "" "已经弃用了一些旧的调用 :func:`~django.views.decorators.cache.cache_page` 的方" "式。请查阅文档以了解正确使用此装饰器的方法。" msgid "Support for PostgreSQL versions older than 8.2" msgstr "支持早于 8.2 版本的 PostgreSQL" msgid "" "Django 1.3 dropped support for PostgreSQL versions older than 8.0, and we " "suggested using a more recent version because of performance improvements " "and, more importantly, the end of upstream support periods for 8.0 and 8.1 " "was near (November 2010)." msgstr "" "Django 1.3 放弃了对早于 8.0 版本的 PostgreSQL 的支持,我们建议使用更新的版" "本,因为性能得到了改进,更重要的是,8.0 和 8.1 的上游支持期即将结束(2010 年 " "11 月)。" msgid "" "Django 1.4 takes that policy further and sets 8.2 as the minimum PostgreSQL " "version it officially supports." msgstr "" "Django 1.4 进一步执行了该政策,并将 8.2 设置为官方支持的最低 PostgreSQL 版" "本。" msgid "Request exceptions are now always logged" msgstr "请求异常现在总是被记录" msgid "" "When we added :doc:`logging support ` in Django in 1.3, " "the admin error email support was moved into the :class:`django.utils.log." "AdminEmailHandler`, attached to the ``'django.request'`` logger. In order to " "maintain the established behavior of error emails, the ``'django.request'`` " "logger was called only when :setting:`DEBUG` was ``False``." msgstr "" "当我们在 Django 1.3 中添加了 :doc:`日志支持 ` 时,管理后台" "错误电子邮件支持被移动到 :class:`django.utils.log.AdminEmailHandler`,并附加" "到 ``'django.request'`` 记录器上。为了保持错误电子邮件的已建立行为,只有在 :" "setting:`DEBUG` 为 ``False`` 时才会调用 ``'django.request'`` 记录器。" msgid "" "To increase the flexibility of error logging for requests, the ``'django." "request'`` logger is now called regardless of the value of :setting:`DEBUG`, " "and the default settings file for new projects now includes a separate " "filter attached to :class:`django.utils.log.AdminEmailHandler` to prevent " "admin error emails in ``DEBUG`` mode::" msgstr "" "为了增加请求的错误日志记录的灵活性,现在无论 :setting:`DEBUG` 的值如何,都会" "调用 ``'django.request'`` 记录器,并且新项目的默认设置文件现在包括一个附加" "到 :class:`django.utils.log.AdminEmailHandler` 的独立过滤器,以防止在 " "``DEBUG`` 模式下发送管理错误电子邮件:" msgid "" "If your project was created prior to this change, your :setting:`LOGGING` " "setting will not include this new filter. In order to maintain backwards-" "compatibility, Django will detect that your ``'mail_admins'`` handler " "configuration includes no ``'filters'`` section and will automatically add " "this filter for you and issue a pending-deprecation warning. This will " "become a deprecation warning in Django 1.5, and in Django 1.6 the backwards-" "compatibility shim will be removed entirely." msgstr "" "如果您的项目在这个改变之前创建的,那么您的 :setting:`LOGGING` 设置将不包括这" "个新的过滤器。为了保持向后兼容性,Django 将检测到您的 ``'mail_admins'`` 处理" "程序配置不包括 ``'filters'`` 部分,并将自动为您添加这个过滤器并发出一个即将弃" "用的警告。在 Django 1.5 中,这将成为一个弃用警告,在 Django 1.6 中,向后兼容" "性的 shim 将被完全移除。" msgid "" "The existence of any ``'filters'`` key under the ``'mail_admins'`` handler " "will disable this backward-compatibility shim and deprecation warning." msgstr "" "在 ``'mail_admins'`` 处理程序下存在任何 ``'filters'`` 键将禁用这个向后兼容性 " "shim 和弃用警告。" msgid "``django.conf.urls.defaults``" msgstr "``django.conf.urls.defaults``" msgid "" "Until Django 1.3, the ``include()``, ``patterns()``, and ``url()`` " "functions, plus :data:`~django.conf.urls.handler404` and :data:`~django.conf." "urls.handler500` were located in a ``django.conf.urls.defaults`` module." msgstr "" "在 Django 1.3 之前,``include()``, ``patterns()``, 和 ``url()`` 函数,以及 :" "data:`~django.conf.urls.handler404` 和 :data:`~django.conf.urls.handler500` " "都位于一个名为 ``django.conf.urls.defaults`` 的模块中。" msgid "In Django 1.4, they live in :mod:`django.conf.urls`." msgstr "在 Django 1.4 中,它们位于 :mod:`django.conf.urls` 模块中。" msgid "``django.contrib.databrowse``" msgstr "``django.contrib.databrowse``" msgid "" "Databrowse has not seen active development for some time, and this does not " "show any sign of changing. There had been a suggestion for a `GSOC project`_ " "to integrate the functionality of databrowse into the admin, but no progress " "was made. While Databrowse has been deprecated, an enhancement of ``django." "contrib.admin`` providing a similar feature set is still possible." msgstr "" "Databrowse 已经有一段时间没有进行积极开发了,而且目前看来也没有改变的迹象。曾" "经有一个关于将 Databrowse 的功能整合到管理员界面的 `GSOC 项目`_ 的建议,但没" "有取得进展。虽然 Databrowse 已经被弃用,但仍然有可能通过增强 ``django." "contrib.admin`` 来提供类似的功能集。" msgid "" "The code that powers Databrowse is licensed under the same terms as Django " "itself, so it's available to be adopted by an individual or group as a third-" "party project." msgstr "" "支持 Databrowse 的代码在与 Django 相同的条款下获得许可,因此个人或团队可以将" "其作为第三方项目采用。" msgid "``django.core.management.setup_environ``" msgstr "``django.core.management.setup_environ``" msgid "" "This function temporarily modified ``sys.path`` in order to make the parent " "\"project\" directory importable under the old flat :djadmin:`startproject` " "layout. This function is now deprecated, as its path workarounds are no " "longer needed with the new ``manage.py`` and default project layout." msgstr "" "这个函数在旧的扁平 :djadmin:`startproject` 布局下,为了使父级 \"project\" 目" "录可导入,临时修改了 ``sys.path``。由于新的 ``manage.py`` 和默认项目布局不再" "需要路径的解决办法,因此此函数现在已经弃用。" msgid "" "This function was never documented or part of the public API, but it was " "widely recommended for use in setting up a \"Django environment\" for a user " "script. These uses should be replaced by setting the :envvar:" "`DJANGO_SETTINGS_MODULE` environment variable or using :func:`django.conf." "settings.configure`." msgstr "" "这个函数从未被文档化或列为公共 API 的一部分,但它曾广泛推荐用于为用户脚本设" "置 \"Django 环境\"。这些用法应该通过设置 :envvar:`DJANGO_SETTINGS_MODULE` 环" "境变量或使用 :func:`django.conf.settings.configure` 来替代。" msgid "``django.core.management.execute_manager``" msgstr "``django.core.management.execute_manager``" msgid "" "This function was previously used by ``manage.py`` to execute a management " "command. It is identical to ``django.core.management." "execute_from_command_line``, except that it first calls ``setup_environ``, " "which is now deprecated. As such, ``execute_manager`` is also deprecated; " "``execute_from_command_line`` can be used instead. Neither of these " "functions is documented as part of the public API, but a deprecation path is " "needed due to use in existing ``manage.py`` files." msgstr "" "这个函数以前被 ``manage.py`` 用于执行管理命令。它与 ``django.core.management." "execute_from_command_line`` 完全相同,只是它首先调用了 ``setup_environ``,而" "这个函数现在已经弃用。因此,``execute_manager`` 也已经弃用;可以使用 " "``execute_from_command_line`` 代替。虽然这两个函数都没有被文档化为公共 API 的" "一部分,但由于在现有的 ``manage.py`` 文件中的使用,需要一个弃用路径。" msgid "``is_safe`` and ``needs_autoescape`` attributes of template filters" msgstr "模板过滤器的 ``is_safe`` 和 ``needs_autoescape`` 属性:" msgid "" "Two flags, ``is_safe`` and ``needs_autoescape``, define how each template " "filter interacts with Django's auto-escaping behavior. They used to be " "attributes of the filter function::" msgstr "" "两个标志,``is_safe`` 和 ``needs_autoescape``,定义了每个模板过滤器与 Django " "的自动转义行为的交互方式。它们以前是过滤器函数的属性:" msgid "" "However, this technique caused some problems in combination with decorators, " "especially :func:`@stringfilter `. Now, the flags are keyword arguments of :meth:`@register." "filter `::" msgstr "" "然而,这种技术在与装饰器结合使用时会引发一些问题,特别是 :func:" "`@stringfilter `。现在,这些标志" "是 :meth:`@register.filter ` 的关键字参数:" msgid "" "See :ref:`filters and auto-escaping ` for more " "information." msgstr "" "请参阅 :ref:`过滤器和自动转义 ` 以获取更多信息。" msgid "Wildcard expansion of application names in ``INSTALLED_APPS``" msgstr "在 ``INSTALLED_APPS`` 中应用程序名称的通配符扩展" msgid "" "Until Django 1.3, :setting:`INSTALLED_APPS` accepted wildcards in " "application names, like ``django.contrib.*``. The expansion was performed by " "a filesystem-based implementation of ``from import *``. " "Unfortunately, this can't be done reliably." msgstr "" "在 Django 1.3 之前,:setting:`INSTALLED_APPS` 中接受应用程序名称中的通配符," "例如 ``django.contrib.*``。扩展是通过基于文件系统的 ``from import " "*`` 实现的。不幸的是,这种方法无法可靠地执行。" msgid "" "This behavior was never documented. Since it is unpythonic, it was removed " "in Django 1.4. If you relied on it, you must edit your settings file to list " "all your applications explicitly." msgstr "" "这种行为从未被记录。由于它不符合 Python 的风格,所以在 Django 1.4 中被移除" "了。如果您依赖于它,您必须编辑设置文件,明确列出所有应用程序。" msgid "``HttpRequest.raw_post_data`` renamed to ``HttpRequest.body``" msgstr "``HttpRequest.raw_post_data`` 已经重命名为 ``HttpRequest.body``" msgid "" "This attribute was confusingly named ``HttpRequest.raw_post_data``, but it " "actually provided the body of the HTTP request. It's been renamed to " "``HttpRequest.body``, and ``HttpRequest.raw_post_data`` has been deprecated." msgstr "" "这个属性的命名有点混淆,虽然它被命名为 ``HttpRequest.raw_post_data``,但它实" "际上提供了 HTTP 请求的主体。它已被重命名为 ``HttpRequest.body``,而 " "``HttpRequest.raw_post_data`` 已被弃用。" msgid "" "``django.contrib.sitemaps`` bug fix with potential performance implications" msgstr "``django.contrib.sitemaps`` 中的 bug 修复可能会影响性能" msgid "" "In previous versions, ``Paginator`` objects used in sitemap classes were " "cached, which could result in stale site maps. We've removed the caching, so " "each request to a site map now creates a new Paginator object and calls the :" "attr:`~django.contrib.sitemaps.Sitemap.items()` method of the :class:" "`~django.contrib.sitemaps.Sitemap` subclass. Depending on what your " "``items()`` method is doing, this may have a negative performance impact. To " "mitigate the performance impact, consider using the :doc:`caching framework " "` within your ``Sitemap`` subclass." msgstr "" "在之前的版本中,用于站点地图类的 ``Paginator`` 对象被缓存,这可能导致站点地图" "过期。我们已经移除了缓存,所以现在每次请求站点地图都会创建一个新的 Paginator " "对象,并调用 :class:`~django.contrib.sitemaps.Sitemap` 子类的 :attr:`~django." "contrib.sitemaps.Sitemap.items()` 方法。根据你的 ``items()`` 方法的具体操作," "这可能会对性能产生负面影响。为了缓解性能影响,考虑在你的 ``Sitemap`` 子类中使" "用 :doc:`缓存框架 `。" msgid "Versions of Python-Markdown earlier than 2.1" msgstr "早于 2.1 版本的 Python-Markdown" msgid "" "Versions of Python-Markdown earlier than 2.1 do not support the option to " "disable attributes. As a security issue, earlier versions of this library " "will not be supported by the markup contrib app in 1.5 under an accelerated " "deprecation timeline." msgstr "" "早于 2.1 版本的 Python-Markdown 不支持禁用属性的选项。作为一个安全问题,在加" "速弃用时间表下,1.5 版本的 markup contrib 应用程序将不支持此库的早期版本。" msgid "Django 1.4.1 release notes" msgstr "Django 1.4.1 版本发行说明" msgid "" "This is the first security release in the Django 1.4 series, fixing several " "security issues in Django 1.4. Django 1.4.1 is a recommended upgrade for all " "users of Django 1.4." msgstr "" "这是 Django 1.4 系列中的第一个安全发布,修复了 Django 1.4 中的几个安全问题。" "对于所有 Django 1.4 用户,推荐升级到 Django 1.4.1 。" msgid "Django 1.4.10 release notes" msgstr "Django 1.4.10 版本发行说明" msgid "*November 6, 2013*" msgstr "*2013 年 11 月 6 日*" msgid "Django 1.4.10 fixes a Python-compatibility bug in the 1.4 series." msgstr "Django 1.4.10 修复了 1.4 系列中的一个 Python 兼容性错误。" msgid "" "Django 1.4.9 inadvertently introduced issues with Python 2.5 compatibility. " "Django 1.4.10 restores Python 2.5 compatibility. This was issue #21362 in " "Django's Trac." msgstr "" "Django 1.4.9 无意中引入了与 Python 2.5 兼容性的问题。 Django 1.4.10 恢复了 " "Python 2.5 的兼容性。这是 Django Trac 中的问题 #21362 。" msgid "Django 1.4.11 release notes" msgstr "Django 1.4.11 版本发行说明" msgid "*April 21, 2014*" msgstr "*2014 年 4 月 21 日*" msgid "" "Django 1.4.11 fixes three security issues in 1.4.10. Additionally, Django's " "vendored version of six, ``django.utils.six``, has been upgraded to the " "latest release (1.6.1)." msgstr "" "Django 1.4.11 修复了 1.4.10 中的三个安全问题。另外,Django 中内置的 six 版" "本,即 ``django.utils.six``,已经升级到最新版本 (1.6.1)。" msgid "Unexpected code execution using ``reverse()``" msgstr "使用 ``reverse()`` 时出现意外的代码执行" msgid "" "Django's URL handling is based on a mapping of regex patterns (representing " "the URLs) to callable views, and Django's own processing consists of " "matching a requested URL against those patterns to determine the appropriate " "view to invoke." msgstr "" "Django 的 URL 处理基于正则表达式模式(表示 URL)到可调用视图的映射,而 " "Django 自身的处理包括将请求的 URL 与这些模式进行匹配,以确定要调用的适当视" "图。" msgid "" "Django also provides a convenience function -- ``reverse()`` -- which " "performs this process in the opposite direction. The ``reverse()`` function " "takes information about a view and returns a URL which would invoke that " "view. Use of ``reverse()`` is encouraged for application developers, as the " "output of ``reverse()`` is always based on the current URL patterns, meaning " "developers do not need to change other code when making changes to URLs." msgstr "" "Django 还提供了一个方便的函数 -- ``reverse()`` -- 用于执行与之相反的过程。" "``reverse()`` 函数接收有关视图的信息,并返回调用该视图的 URL。鼓励应用程序开" "发人员使用 ``reverse()``,因为``reverse()`` 的输出总是基于当前的 URL 模式,这" "意味着开发人员在更改 URL 时不需要修改其他代码。" msgid "" "One argument signature for ``reverse()`` is to pass a dotted Python path to " "the desired view. In this situation, Django will import the module indicated " "by that dotted path as part of generating the resulting URL. If such a " "module has import-time side effects, those side effects will occur." msgstr "" "``reverse()`` 的一个参数签名是传递所需视图的点分 Python 路径。在这种情况下," "Django 将导入由该点分路径指示的模块,作为生成结果 URL 的一部分。如果这样的模" "块在导入时具有副作用,那么这些副作用将会发生。" msgid "" "Thus it is possible for an attacker to cause unexpected code execution, " "given the following conditions:" msgstr "因此,在满足以下条件时,攻击者可能导致意外的代码执行:" msgid "" "One or more views are present which construct a URL based on user input " "(commonly, a \"next\" parameter in a querystring indicating where to " "redirect upon successful completion of an action)." msgstr "" "存在一个或多个视图,它们根据用户输入构建 URL(通常是查询字符串中的“next”参" "数,指示在操作成功完成后重定向到哪里)。" msgid "" "One or more modules are known to an attacker to exist on the server's Python " "import path, which perform code execution with side effects on importing." msgstr "" "攻击者知道服务器的 Python 导入路径上存在一个或多个模块,在导入时执行具有副作" "用的代码。" msgid "" "To remedy this, ``reverse()`` will now only accept and import dotted paths " "based on the view-containing modules listed in the project's :doc:`URL " "pattern configuration `, so as to ensure that only " "modules the developer intended to be imported in this fashion can or will be " "imported." msgstr "" "为了解决这个问题,``reverse()`` 现在将只接受并导入基于项目的 :doc:`URL 模式配" "置 ` 中列出的包含视图的模块的点分路径,以确保只有开发人员" "打算以这种方式导入的模块才能被导入。" msgid "Caching of anonymous pages could reveal CSRF token" msgstr "缓存匿名页面可能会泄露 CSRF 令牌" msgid "" "Django includes both a :doc:`caching framework ` and a system " "for :doc:`preventing cross-site request forgery (CSRF) attacks `. The CSRF-protection system is based on a random nonce sent to the client " "in a cookie which must be sent by the client on future requests and, in " "forms, a hidden value which must be submitted back with the form." msgstr "" "Django 包括了一个 :doc:`缓存框架 ` 和一个用于 :doc:`防止跨站点" "请求伪造 (CSRF) 攻击 ` 的系统。CSRF 保护系统基于一个随机的 " "nonce,它会在 cookie 中发送给客户端,在将来的请求中客户端必须发送该 nonce,同" "时在表单中还有一个隐藏值,必须与表单一起提交。" msgid "" "The caching framework includes an option to cache responses to anonymous (i." "e., unauthenticated) clients." msgstr "缓存框架包括一个选项,用于缓存对匿名(即未经认证的)客户端的响应。" msgid "" "When the first anonymous request to a given page is by a client which did " "not have a CSRF cookie, the cache framework will also cache the CSRF cookie " "and serve the same nonce to other anonymous clients who do not have a CSRF " "cookie. This can allow an attacker to obtain a valid CSRF cookie value and " "perform attacks which bypass the check for the cookie." msgstr "" "当第一个对指定页面的匿名请求来自没有 CSRF cookie 的客户端时,缓存框架还会缓" "存 CSRF cookie,并为没有 CSRF cookie 的其他匿名客户端提供相同的随机数。这可能" "使攻击者获得有效的 CSRF cookie 值,并执行绕过 cookie 检查的攻击。" msgid "" "To remedy this, the caching framework will no longer cache such responses. " "The heuristic for this will be:" msgstr "为了解决这个问题,缓存框架将不再缓存此类响应。启发式方法将是:" msgid "If the incoming request did not submit any cookies, and" msgstr "如果传入的请求没有提交任何 cookie,且" msgid "If the response did send one or more cookies, and" msgstr "如果响应发送了一个或多个 cookie,且" msgid "" "If the ``Vary: Cookie`` header is set on the response, then the response " "will not be cached." msgstr "如果在响应中设置了 ``Vary: Cookie`` 头,那么该响应将不会被缓存。" msgid "MySQL typecasting" msgstr "MySQL 类型转换" msgid "" "The MySQL database is known to \"typecast\" on certain queries; for example, " "when querying a table which contains string values, but using a query which " "filters based on an integer value, MySQL will first silently coerce the " "strings to integers and return a result based on that." msgstr "" "众所周知,MySQL 数据库会对某些查询进行“类型转换”;例如,在查询包含字符串值的" "表时,但使用基于整数值进行过滤的查询,MySQL 首先会默默地将字符串强制转换为整" "数,然后返回基于该整数的结果。" msgid "" "If a query is performed without first converting values to the appropriate " "type, this can produce unexpected results, similar to what would occur if " "the query itself had been manipulated." msgstr "" "如果在未先将值转换为适当类型的情况下执行查询,这可能产生意外的结果,类似于查" "询本身被操作时会发生的情况。" msgid "" "Django's model field classes are aware of their own types and most such " "classes perform explicit conversion of query arguments to the correct " "database-level type before querying. However, three model field classes did " "not correctly convert their arguments:" msgstr "" "Django 的模型字段类知道它们自己的类型,大多数此类字段在查询之前会将查询参数明" "确转换为正确的数据库级别类型。然而,有三个模型字段类没有正确地转换它们的参" "数:" msgid ":class:`~django.db.models.FilePathField`" msgstr ":class:`~django.db.models.FilePathField`" msgid ":class:`~django.db.models.GenericIPAddressField`" msgstr ":class:`~django.db.models.GenericIPAddressField`" msgid "``IPAddressField``" msgstr "``IPAddressField``" msgid "" "These three fields have been updated to convert their arguments to the " "correct types before querying." msgstr "在查询之前,这三个字段已经更新为将参数转换为正确的类型。" msgid "" "Additionally, developers of custom model fields are now warned via " "documentation to ensure their custom field classes will perform appropriate " "type conversions, and users of the :meth:`raw() ` and :meth:`extra() ` " "query methods -- which allow the developer to supply raw SQL or SQL " "fragments -- will be advised to ensure they perform appropriate manual type " "conversions prior to executing queries." msgstr "" "此外,自定义模型字段的开发人员现在通过文档受到警告,需要确保他们的自定义字段" "类能够执行适当的类型转换,以及使用 :meth:`raw() ` 和 :meth:`extra() ` 查" "询方法的用户将被建议确保在执行查询之前进行适当的手动类型转换,因为这些方法允" "许开发人员提供原始 SQL 或 SQL 片段。" msgid "Django 1.4.12 release notes" msgstr "Django 1.4.12 版本发行说明" msgid "*April 28, 2014*" msgstr "*2014 年 4 月 28 日*" msgid "Django 1.4.12 fixes a regression in the 1.4.11 security release." msgstr "Django 1.4.12 修复了 1.4.11 安全发布中的一个回归问题。" msgid "" "Restored the ability to ``reverse()`` views created using :func:`functools." "partial()` (:ticket:`22486`)." msgstr "" "已恢复了使用 :func:`functools.partial()` 创建的视图的 ``reverse()`` 能力 (:" "ticket:`22486`)。" msgid "Django 1.4.13 release notes" msgstr "Django 1.4.13 版本发行说明" msgid "*May 14, 2014*" msgstr "*2014 年 5 月 14 日*" msgid "Django 1.4.13 fixes two security issues in 1.4.12." msgstr "Django 1.4.13 修复了 1.4.12 中的两个安全问题。" msgid "Caches may incorrectly be allowed to store and serve private data" msgstr "缓存可能会错误地允许存储和提供私有数据" msgid "" "In certain situations, Django may allow caches to store private data related " "to a particular session and then serve that data to requests with a " "different session, or no session at all. This can lead to information " "disclosure and can be a vector for cache poisoning." msgstr "" "在某些情况下,Django 可能允许缓存存储与特定会话相关的私有数据,然后将该数据提" "供给具有不同会话或根本没有会话的请求。这可能导致信息泄露,并可能成为缓存中毒" "的途径。" msgid "" "When using Django sessions, Django will set a ``Vary: Cookie`` header to " "ensure caches do not serve cached data to requests from other sessions. " "However, older versions of Internet Explorer (most likely only Internet " "Explorer 6, and Internet Explorer 7 if run on Windows XP or Windows Server " "2003) are unable to handle the ``Vary`` header in combination with many " "content types. Therefore, Django would remove the header if the request was " "made by Internet Explorer." msgstr "" "在使用 Django 会话时,Django 会设置一个 ``Vary: Cookie`` 头,以确保缓存不会向" "来自其他会话的请求提供缓存的数据。但是,较旧版本的 Internet Explorer(可能只" "有 Internet Explorer 6,以及如果在 Windows XP 或 Windows Server 2003 上运行" "的 Internet Explorer 7)无法处理 ``Vary`` 头与许多内容类型的组合。因此,如果" "请求是由 Internet Explorer 发出的,Django 会删除该头。" msgid "" "To remedy this, the special behavior for these older Internet Explorer " "versions has been removed, and the ``Vary`` header is no longer stripped " "from the response. In addition, modifications to the ``Cache-Control`` " "header for all Internet Explorer requests with a ``Content-Disposition`` " "header have also been removed as they were found to have similar issues." msgstr "" "为了解决这个问题,已经移除了对这些较旧的 Internet Explorer 版本的特殊行为,并" "且不再从响应中删除 ``Vary`` 头。此外,对所有具有 ``Content-Disposition`` 头" "的 Internet Explorer 请求的 ``Cache-Control`` 头的修改也已被移除,因为发现它" "们具有类似的问题。" msgid "Malformed redirect URLs from user input not correctly validated" msgstr "来自用户输入的格式错误的重定向 URL 未正确验证" msgid "" "The validation for redirects did not correctly validate some malformed URLs, " "which are accepted by some browsers. This allows a user to be redirected to " "an unsafe URL unexpectedly." msgstr "" "重定向验证未正确验证某些格式错误的 URL,这些 URL 被某些浏览器接受。这使得用户" "可能意外地被重定向到不安全的 URL 。" msgid "" "Django relies on user input in some cases (e.g. ``django.contrib.auth.views." "login()``, ``django.contrib.comments``, and :doc:`i18n `) to redirect the user to an \"on success\" URL. The security checks " "for these redirects (namely ``django.utils.http.is_safe_url()``) did not " "correctly validate some malformed URLs, such as ``http:\\\\\\\\\\" "\\djangoproject.com``, which are accepted by some browsers with more liberal " "URL parsing." msgstr "" "Django 在某些情况下(例如 ``django.contrib.auth.views.login()``、``django." "contrib.comments`` 和 :doc:`i18n `)依赖于用户输入来将用" "户重定向到“成功”URL。对于这些重定向的安全性检查(即 ``django.utils.http." "is_safe_url()``),未正确验证一些格式错误的 URL,例如 ``http:\\\\\\\\\\" "\\djangoproject.com``,这些 URL 可以被一些具有更自由 URL 解析的浏览器接受。" msgid "" "To remedy this, the validation in ``is_safe_url()`` has been tightened to be " "able to handle and correctly validate these malformed URLs." msgstr "" "为了解决这个问题,``is_safe_url()`` 中的验证已经加强,能够处理和正确验证这些" "格式错误的 URL。" msgid "Django 1.4.14 release notes" msgstr "Django 1.4.14 版本发行说明" msgid "*August 20, 2014*" msgstr "*2014 年 8 月 20 日*" msgid "Django 1.4.14 fixes several security issues in 1.4.13." msgstr "Django 1.4.14 修复了 1.4.13 中的多个安全问题。" msgid "``reverse()`` could generate URLs pointing to other hosts" msgstr "``reverse()`` 可能生成指向其他主机的 URL" msgid "" "In certain situations, URL reversing could generate scheme-relative URLs " "(URLs starting with two slashes), which could unexpectedly redirect a user " "to a different host. An attacker could exploit this, for example, by " "redirecting users to a phishing site designed to ask for user's passwords." msgstr "" "在某些情况下,URL 反转可能生成方案相对的 URL(以两个斜杠开头的 URL),这可能" "会使用户意外地被重定向到另一个主机。攻击者可以利用这一点,例如,通过将用户重" "定向到一个专门设计用来索取用户密码的钓鱼网站。" msgid "" "To remedy this, URL reversing now ensures that no URL starts with two " "slashes (//), replacing the second slash with its URL encoded counterpart " "(%2F). This approach ensures that semantics stay the same, while making the " "URL relative to the domain and not to the scheme." msgstr "" "为了解决这个问题,URL 反查现在确保没有 URL 以两个斜杠(//)开头,用其 URL 编" "码的对应项( %2F )替换第二个斜杠。这种方法确保语义保持不变,同时使 URL 相对" "于域而不是协议。" msgid "File upload denial-of-service" msgstr "文件上传拒绝服务攻击" msgid "" "Before this release, Django's file upload handing in its default " "configuration may degrade to producing a huge number of ``os.stat()`` system " "calls when a duplicate filename is uploaded. Since ``stat()`` may invoke IO, " "this may produce a huge data-dependent slowdown that slowly worsens over " "time. The net result is that given enough time, a user with the ability to " "upload files can cause poor performance in the upload handler, eventually " "causing it to become very slow simply by uploading 0-byte files. At this " "point, even a slow network connection and few HTTP requests would be all " "that is necessary to make a site unavailable." msgstr "" "在此版本之前,在其默认配置下,Django 的文件上传处理在上传重复文件名时可能会退" "化为产生大量的 ``os.stat()`` 系统调用。由于 ``stat()`` 可能会引发 IO 操作,这" "可能会导致数据相关的巨大性能下降,随着时间的推移逐渐恶化。最终结果是,给定足" "够的时间,具有上传文件权限的用户可以通过上传 0 字节文件来导致上传处理程序性能" "下降,最终导致它变得非常慢。在这一点上,即使是较慢的网络连接和少量的 HTTP 请" "求也足以使站点不可用。" msgid "" "We've remedied the issue by changing the algorithm for generating file names " "if a file with the uploaded name already exists. :meth:`Storage." "get_available_name() ` " "now appends an underscore plus a random 7 character alphanumeric string (e." "g. ``\"_x3a1gho\"``), rather than iterating through an underscore followed " "by a number (e.g. ``\"_1\"``, ``\"_2\"``, etc.)." msgstr "" "我们通过更改生成文件名的算法来解决了这个问题,如果已经存在具有上传名称的文" "件,那么 :meth:`Storage.get_available_name() ` 现在会附加一个下划线和一个随机的 7 位字母数字字" "符串(例如 ``\"_x3a1gho\"``),而不是通过迭代下划线后面跟着一个数字(例如 " "``\"_1\"``,``\"_2\"`` 等)。" msgid "``RemoteUserMiddleware`` session hijacking" msgstr "``RemoteUserMiddleware`` 会话劫持" msgid "" "When using the :class:`~django.contrib.auth.middleware.RemoteUserMiddleware` " "and the ``RemoteUserBackend``, a change to the ``REMOTE_USER`` header " "between requests without an intervening logout could result in the prior " "user's session being co-opted by the subsequent user. The middleware now " "logs the user out on a failed login attempt." msgstr "" "在使用 :class:`~django.contrib.auth.middleware.RemoteUserMiddleware` 和 " "``RemoteUserBackend`` 时,在没有中断注销的情况下,在请求之间更改 " "``REMOTE_USER`` 标头可能会导致后续用户接管之前用户的会话。现在,在登录尝试失" "败时,中间件会注销用户。" msgid "Data leakage via query string manipulation in ``contrib.admin``" msgstr "通过查询字符串操纵在 ``contrib.admin`` 中的数据泄露" msgid "" "In older versions of Django it was possible to reveal any field's data by " "modifying the \"popup\" and \"to_field\" parameters of the query string on " "an admin change form page. For example, requesting a URL like ``/admin/auth/" "user/?pop=1&t=password`` and viewing the page's HTML allowed viewing the " "password hash of each user. While the admin requires users to have " "permissions to view the change form pages in the first place, this could " "leak data if you rely on users having access to view only certain fields on " "a model." msgstr "" "在旧版本的 Django 中,通过修改查询字符串上的 \"popup\" 和 \"to_field\" 参数," "可以揭示任何字段的数据。例如,请求像 ``/admin/auth/user/?pop=1&t=password`` " "这样的 URL 并查看页面的 HTML 允许查看每个用户的密码哈希。尽管管理员要求用户首" "先具有查看更改表单页面的权限,但如果你依赖于用户只能访问模型上的特定字段,这" "可能会泄漏数据。" msgid "" "To address the issue, an exception will now be raised if a ``to_field`` " "value that isn't a related field to a model that has been registered with " "the admin is specified." msgstr "" "为了解决这个问题,现在如果指定了一个不是与已在管理员中注册的模型相关的字段的 " "``to_field`` 值,将引发异常。" msgid "Django 1.4.15 release notes" msgstr "Django 1.4.15 版本发行说明" msgid "*September 2, 2014*" msgstr "*2014 年 9 月 2 日*" msgid "Django 1.4.15 fixes a regression in the 1.4.14 security release." msgstr "Django 1.4.15 修复了 1.4.14 安全发布中的一个回归问题。" msgid "" "Allowed inherited and m2m fields to be referenced in the admin (:ticket:" "`22486`)" msgstr "允许引用继承和多对多字段在管理员中 (:ticket:`22486`)。" msgid "Django 1.4.16 release notes" msgstr "Django 1.4.16 版本发行说明" msgid "*October 22, 2014*" msgstr "*2014 年 10 月 22日*" msgid "" "Django 1.4.16 fixes a couple regressions in the 1.4.14 security release and " "a bug preventing the use of some GEOS versions with GeoDjango." msgstr "" "Django 1.4.16 修复了 1.4.14 安全版本中的一些回归问题,以及阻止使用某些 GEOS " "版本与 GeoDjango 一起使用的错误。" msgid "" "Allowed related many-to-many fields to be referenced in the admin (:ticket:" "`23604`)." msgstr "允许引用相关的多对多字段在管理员中 (:ticket:`23604`)。" msgid "Allowed inline and hidden references to admin fields (:ticket:`23431`)." msgstr "允许内联和隐藏引用管理员字段 (:ticket:`23431`)。" msgid "Fixed parsing of the GEOS version string (:ticket:`20036`)." msgstr "修复了 GEOS 版本字符串的解析问题 (:ticket:`20036`)。" msgid "Django 1.4.17 release notes" msgstr "Django 1.4.17 版本发行说明" msgid "*January 2, 2015*" msgstr "*2015 年 1 月 2 日*" msgid "Django 1.4.17 fixes a regression in the 1.4.14 security release." msgstr "Django 1.4.17 修复了 1.4.14 安全版本中的一个回归问题。" msgid "" "Additionally, Django's vendored version of six, ``django.utils.six``, has " "been upgraded to the latest release (1.9.0)." msgstr "" "此外,Django 内置的 six 版本,即 ``django.utils.six``,已经升级到最新版本 " "(1.9.0)。" msgid "" "Fixed a regression with dynamically generated inlines and allowed field " "references in the admin (:ticket:`23754`)." msgstr "" "修复了动态生成的内联和允许在管理员中引用字段的回归问题 (:ticket:`23754`)。" msgid "Django 1.4.18 release notes" msgstr "Django 1.4.18 版本发行说明" msgid "*January 13, 2015*" msgstr "*2015 年 1 月 13 日*" msgid "" "Django 1.4.18 fixes several security issues in 1.4.17 as well as a " "regression on Python 2.5 in the 1.4.17 release." msgstr "" "Django 1.4.18 修复了 1.4.17 中的几个安全问题,以及 1.4.17 版本中出现的 " "Python 2.5 的回归问题。" msgid "WSGI header spoofing via underscore/dash conflation" msgstr "通过下划线/破折号混淆进行 WSGI 头欺骗" msgid "" "When HTTP headers are placed into the WSGI environ, they are normalized by " "converting to uppercase, converting all dashes to underscores, and " "prepending ``HTTP_``. For instance, a header ``X-Auth-User`` would become " "``HTTP_X_AUTH_USER`` in the WSGI environ (and thus also in Django's " "``request.META`` dictionary)." msgstr "" "当将 HTTP 头放入 WSGI 环境时,它们会被规范化,即转换为大写,将所有破折号转换" "为下划线,并在前面添加 ``HTTP_``。例如,一个名为 ``X-Auth-User`` 的头部在 " "WSGI 环境中会变成 ``HTTP_X_AUTH_USER`` (因此也会出现在 Django 的 ``request." "META`` 字典中)。" msgid "" "Unfortunately, this means that the WSGI environ cannot distinguish between " "headers containing dashes and headers containing underscores: ``X-Auth-" "User`` and ``X-Auth_User`` both become ``HTTP_X_AUTH_USER``. This means that " "if a header is used in a security-sensitive way (for instance, passing " "authentication information along from a front-end proxy), even if the proxy " "carefully strips any incoming value for ``X-Auth-User``, an attacker may be " "able to provide an ``X-Auth_User`` header (with underscore) and bypass this " "protection." msgstr "" "不幸的是,这意味着 WSGI 环境无法区分包含破折号和包含下划线的头部:``X-Auth-" "User`` 和 ``X-Auth_User`` 都会变成 ``HTTP_X_AUTH_USER``。这意味着如果一个头部" "以安全敏感的方式使用(例如,从前端代理传递身份验证信息),即使代理仔细删除了 " "``X-Auth-User`` 的任何传入值,攻击者仍然可以提供一个带下划线的 ``X-" "Auth_User`` 头部,并绕过这种保护。" msgid "" "In order to prevent such attacks, both Nginx and Apache 2.4+ strip all " "headers containing underscores from incoming requests by default. Django's " "built-in development server now does the same. Django's development server " "is not recommended for production use, but matching the behavior of common " "production servers reduces the surface area for behavior changes during " "deployment." msgstr "" "为了防止此类攻击,Nginx 和 Apache 2.4+ 默认会从传入的请求中剥离包含下划线的所" "有标头。 Django 的内置开发服务器现在也采用相同的做法。不建议将 Django 的开发" "服务器用于生产环境,但匹配常见生产服务器的行为可以减少部署过程中行为变化的可" "能性。" msgid "Mitigated possible XSS attack via user-supplied redirect URLs" msgstr "通过用户提供的重定向 URL 减轻了可能的 XSS 攻击风险。" msgid "" "Django relies on user input in some cases (e.g. ``django.contrib.auth.views." "login()`` and :doc:`i18n `) to redirect the user to an " "\"on success\" URL. The security checks for these redirects (namely ``django." "utils.http.is_safe_url()``) didn't strip leading whitespace on the tested " "URL and as such considered URLs like ``\\njavascript:...`` safe. If a " "developer relied on ``is_safe_url()`` to provide safe redirect targets and " "put such a URL into a link, they could suffer from a XSS attack. This bug " "doesn't affect Django currently, since we only put this URL into the " "``Location`` response header and browsers seem to ignore JavaScript there." msgstr "" "在某些情况下,Django 依赖于用户输入(例如 ``django.contrib.auth.views." "login()`` 和 :doc:`i18n `)来将用户重定向到“成功”URL。这" "些重定向的安全性检查(即 ``django.utils.http.is_safe_url()``)未删除在测试的 " "URL 上的前导空格,因此将类似于 ``\\njavascript:...`` 的 URL 视为安全的。如果" "开发人员依赖于 ``is_safe_url()`` 提供安全的重定向目标,并将这样的 URL 放入链" "接中,他们可能会受到 XSS 攻击的影响。目前这个错误不会影响 Django,因为我们只" "将这个 URL 放入 ``Location`` 响应头中,而浏览器似乎会忽略那里的 JavaScript。" msgid "Denial-of-service attack against ``django.views.static.serve``" msgstr "对 ``django.views.static.serve`` 的拒绝服务攻击" msgid "" "In older versions of Django, the :func:`django.views.static.serve` view read " "the files it served one line at a time. Therefore, a big file with no " "newlines would result in memory usage equal to the size of that file. An " "attacker could exploit this and launch a denial-of-service attack by " "simultaneously requesting many large files. This view now reads the file in " "chunks to prevent large memory usage." msgstr "" "在旧版本的 Django 中,:func:`django.views.static.serve` 视图逐行读取它提供的" "文件。因此,一个没有换行符的大文件将导致内存使用量等于该文件的大小。攻击者可" "以利用这一点,通过同时请求许多大文件来发动拒绝服务攻击。现在,这个视图会按块" "读取文件,以防止大量内存使用。" msgid "" "Note, however, that this view has always carried a warning that it is not " "hardened for production use and should be used only as a development aid. " "Now may be a good time to audit your project and serve your files in " "production using a real front-end web server if you are not doing so." msgstr "" "然而,请注意,这个视图一直带有一个警告,即它没有经过生产环境的强化,只应作为" "开发辅助工具使用。如果您还没有这样做,现在可能是一个好时机来审计您的项目,并" "在生产环境中使用真正的前端 Web 服务器提供文件。" msgid "" "To maintain compatibility with Python 2.5, Django's vendored version of six, " "``django.utils.six``, has been downgraded to 1.8.0 which is the last version " "to support Python 2.5." msgstr "" "为了保持与 Python 2.5 的兼容性,Django 内置的 six 版本,即 ``django.utils." "six``,已经降级到 1.8.0,这是最后一个支持 Python 2.5 的版本。" msgid "Django 1.4.19 release notes" msgstr "Django 1.4.19 版本发行说明" msgid "*January 27, 2015*" msgstr "*2015 年 1 月 27 日*" msgid "Django 1.4.19 fixes a regression in the 1.4.18 security release." msgstr "Django 1.4.19 修复了 1.4.18 安全版本中的一个回归问题。" msgid "" "``GZipMiddleware`` now supports streaming responses. As part of the 1.4.18 " "security release, the ``django.views.static.serve()`` function was altered " "to stream the files it serves. Unfortunately, the ``GZipMiddleware`` " "consumed the stream prematurely and prevented files from being served " "properly (:ticket:`24158`)." msgstr "" "``GZipMiddleware`` 现在支持流式响应。作为 1.4.18 安全更新的一部分,``django." "views.static.serve()`` 函数已经被修改为流式传输它提供的文件。不幸的是," "``GZipMiddleware`` 过早地消耗了流,并阻止了文件的正确传输 (:ticket:`24158`)。" msgid "Django 1.4.2 release notes" msgstr "Django 1.4.2 版本发行说明" msgid "This is the second security release in the Django 1.4 series." msgstr "这是 Django 1.4 系列中的第二个安全版本。" msgid "" "The newly introduced :class:`~django.db.models.GenericIPAddressField` " "constructor arguments have been adapted to match those of all other model " "fields. The first two keyword arguments are now verbose_name and name." msgstr "" "新引入的 :class:`~django.db.models.GenericIPAddressField` 构造函数参数已经适" "应了所有其他模型字段的参数。现在的前两个关键字参数是 verbose_name 和 name。" msgid "Other bugfixes and changes" msgstr "其他错误修复和更改" msgid "Subclass HTMLParser only for appropriate Python versions (#18239)." msgstr "仅对适用的 Python 版本子类化 HTMLParser( #18239 )。" msgid "Added batch_size argument to qs.bulk_create() (#17788)." msgstr "为 qs.bulk_create() 添加 batch_size 参数( #17788 )。" msgid "" "Fixed a small regression in the admin filters where wrongly formatted dates " "passed as url parameters caused an unhandled ValidationError (#18530)." msgstr "" "修复了管理员筛选器中的一个小回归问题,其中错误格式的日期作为 URL 参数传递,导" "致未处理的 ValidationError( #18530 )。" msgid "" "Fixed an endless loop bug when accessing permissions in templates (#18979)" msgstr "修复了在模板中访问权限时出现的无限循环错误( #18979 )" msgid "Fixed some Python 2.5 compatibility issues" msgstr "修复了一些与 Python 2.5 兼容性有关的问题。" msgid "" "Fixed an issue with quoted filenames in Content-Disposition header (#19006)" msgstr "修复了 Content-Disposition 标头中带引号文件名的问题( #19006 )。" msgid "" "Made the context option in ``trans`` and ``blocktrans`` tags accept literals " "wrapped in single quotes (#18881)." msgstr "" "使 ``trans`` 和 ``blocktrans`` 标签中的上下文选项接受用单引号包裹的字面值 " "(#18881)。" msgid "Numerous documentation improvements and fixes." msgstr "大量文档改进和修复。" msgid "Django 1.4.20 release notes" msgstr "Django 1.4.20 版本发行说明" msgid "*March 18, 2015*" msgstr "*2015 年 3 月 18 日*" msgid "Django 1.4.20 fixes one security issue in 1.4.19." msgstr "Django 1.4.20 修复了 1.4.19 中的一个安全问题。" msgid "" "Django relies on user input in some cases (e.g. ``django.contrib.auth.views." "login()`` and :doc:`i18n `) to redirect the user to an " "\"on success\" URL. The security checks for these redirects (namely ``django." "utils.http.is_safe_url()``) accepted URLs with leading control characters " "and so considered URLs like ``\\x08javascript:...`` safe. This issue doesn't " "affect Django currently, since we only put this URL into the ``Location`` " "response header and browsers seem to ignore JavaScript there. Browsers we " "tested also treat URLs prefixed with control characters such as ``%08//" "example.com`` as relative paths so redirection to an unsafe target isn't a " "problem either." msgstr "" "Django 在某些情况下依赖于用户输入(例如 ``django.contrib.auth.views." "login()`` 和 :doc:`i18n `)来将用户重定向到“成功”URL。这" "些重定向的安全性检查(即 ``django.utils.http.is_safe_url()``)接受具有前导控" "制字符的 URL,因此将像 ``\\x08javascript:...`` 这样的 URL 视为安全。目前这个" "问题不会影响 Django,因为我们只将这个 URL 放入 ``Location`` 响应头中,而浏览" "器似乎会忽略那里的 JavaScript。经过我们测试的浏览器还会将以控制字符前缀的 " "URL,如 ``%08//example.com``,视为相对路径,因此重定向到不安全的目标也不是一" "个问题。" msgid "" "However, if a developer relies on ``is_safe_url()`` to provide safe redirect " "targets and puts such a URL into a link, they could suffer from an XSS " "attack as some browsers such as Google Chrome ignore control characters at " "the start of a URL in an anchor ``href``." msgstr "" "然而,如果开发人员依赖于 ``is_safe_url()`` 来提供安全的重定向目标,并将这样" "的 URL 放入链接中,他们可能会受到 XSS 攻击的影响,因为一些浏览器,如 Google " "Chrome,会忽略在锚点的 ``href`` 中 URL 开头的控制字符。" msgid "Django 1.4.21 release notes" msgstr "Django 1.4.21 版本发行说明" msgid "*July 8, 2015*" msgstr "*2015 年 7 月 8 日*" msgid "Django 1.4.21 fixes several security issues in 1.4.20." msgstr "Django 1.4.21 修复了 1.4.20 中的若干安全问题。" msgid "Denial-of-service possibility by filling session store" msgstr "通过填充会话存储可能导致拒绝服务攻击。" msgid "" "In previous versions of Django, the session backends created a new empty " "record in the session storage anytime ``request.session`` was accessed and " "there was a session key provided in the request cookies that didn't already " "have a session record. This could allow an attacker to easily create many " "new session records simply by sending repeated requests with unknown session " "keys, potentially filling up the session store or causing other users' " "session records to be evicted." msgstr "" "在以前版本的 Django 中,会话后端在访问 ``request.session`` 时,如果请求的 " "cookies 中提供了一个没有会话记录的会话键,就会创建一个新的空记录在会话存储" "中。这可能允许攻击者通过发送带有未知会话键的重复请求来轻松创建许多新的会话记" "录,潜在地填满会话存储或导致其他用户的会话记录被逐出。" msgid "" "The built-in session backends now create a session record only if the " "session is actually modified; empty session records are not created. Thus " "this potential DoS is now only possible if the site chooses to expose a " "session-modifying view to anonymous users." msgstr "" "内置的会话后端现在仅在会话实际修改时创建会话记录;不会创建空的会话记录。因" "此,只有在网站选择向匿名用户公开会话修改视图时,才可能发生这种潜在的 DoS 攻" "击。" msgid "" "As each built-in session backend was fixed separately (rather than a fix in " "the core sessions framework), maintainers of third-party session backends " "should check whether the same vulnerability is present in their backend and " "correct it if so." msgstr "" "由于每个内置会话后端都是单独修复的(而不是在核心会话框架中进行修复),第三方" "会话后端的维护者应检查他们的后端是否存在相同的漏洞,并在存在的情况下进行修" "正。" msgid "Header injection possibility since validators accept newlines in input" msgstr "由于验证器接受换行符输入,可能导致头部注入。" msgid "" "Some of Django's built-in validators (:class:`~django.core.validators." "EmailValidator`, most seriously) didn't prohibit newline characters (due to " "the usage of ``$`` instead of ``\\Z`` in the regular expressions). If you " "use values with newlines in HTTP response or email headers, you can suffer " "from header injection attacks. Django itself isn't vulnerable because :class:" "`~django.http.HttpResponse` and the mail sending utilities in :mod:`django." "core.mail` prohibit newlines in HTTP and SMTP headers, respectively. While " "the validators have been fixed in Django, if you're creating HTTP responses " "or email messages in other ways, it's a good idea to ensure that those " "methods prohibit newlines as well. You might also want to validate that any " "existing data in your application doesn't contain unexpected newlines." msgstr "" "Django 的一些内置验证器(尤其是 :class:`~django.core.validators." "EmailValidator`)没有禁止换行字符(因为正则表达式中使用了 ``$`` 而不是 " "``\\Z``)。如果在 HTTP 响应或电子邮件头中使用带有换行符的值,可能会受到头部注" "入攻击的影响。Django 本身不会受到影响,因为 :class:`~django.http." "HttpResponse` 和 :mod:`django.core.mail` 中的邮件发送工具在 HTTP 和 SMTP 头部" "中分别禁止了换行符。尽管验证器已经在 Django 中修复,但如果以其他方式创建 " "HTTP 响应或电子邮件消息,最好确保这些方法也禁止换行符。您还可以验证应用程序中" "的任何现有数据是否包含意外的换行符。" msgid "" ":func:`~django.core.validators.validate_ipv4_address`, :func:`~django.core." "validators.validate_slug`, and :class:`~django.core.validators.URLValidator` " "and their usage in the corresponding form fields ``GenericIPAddresseField``, " "``IPAddressField``, ``SlugField``, and ``URLField`` are also affected." msgstr "" ":func:`~django.core.validators.validate_ipv4_address`、:func:`~django.core." "validators.validate_slug` 和 :class:`~django.core.validators.URLValidator` 以" "及它们在相应的表单字段 ``GenericIPAddresseField``、``IPAddressField``、" "``SlugField`` 和 ``URLField`` 中的使用也受到影响。" msgid "" "The undocumented, internally unused ``validate_integer()`` function is now " "stricter as it validates using a regular expression instead of simply " "casting the value using ``int()`` and checking if an exception was raised." msgstr "" "未记录的、内部未使用的 ``validate_integer()`` 函数现在更加严格,因为它使用正" "则表达式进行验证,而不仅仅是使用 ``int()`` 强制转换值并检查是否引发了异常。" msgid "Django 1.4.22 release notes" msgstr "Django 1.4.22 版本发行说明" msgid "*August 18, 2015*" msgstr "*2015 年 8 月 18 日*" msgid "Django 1.4.22 fixes a security issue in 1.4.21." msgstr "Django 1.4.22 修复了 1.4.21 中的安全问题。" msgid "" "It also fixes support with pip 7+ by disabling wheel support. Older versions " "of 1.4 would silently build a broken wheel when installed with those " "versions of pip." msgstr "" "它还通过禁用 wheel 支持来修复与 pip 7+ 的兼容问题。在使用这些版本的 pip 安装" "时,1.4 的旧版本会悄无声息地构建一个损坏的 wheel 。" msgid "" "Denial-of-service possibility in ``logout()`` view by filling session store" msgstr "在 ``logout()`` 视图中存在拒绝服务的可能性,因为会话存储被填满。" msgid "" "Previously, a session could be created when anonymously accessing the " "``django.contrib.auth.views.logout()`` view (provided it wasn't decorated " "with :func:`~django.contrib.auth.decorators.login_required` as done in the " "admin). This could allow an attacker to easily create many new session " "records by sending repeated requests, potentially filling up the session " "store or causing other users' session records to be evicted." msgstr "" "以前,在匿名访问 ``django.contrib.auth.views.logout()`` 视图时可以创建会话" "(前提是没有像在管理界面中那样使用 :func:`~django.contrib.auth.decorators." "login_required` 进行装饰)。这可能允许攻击者通过发送重复的请求轻松创建许多新" "的会话记录,潜在地填满会话存储或导致其他用户的会话记录被逐出。" msgid "" "The :class:`~django.contrib.sessions.middleware.SessionMiddleware` has been " "modified to no longer create empty session records, including when :setting:" "`SESSION_SAVE_EVERY_REQUEST` is active." msgstr "" ":class:`~django.contrib.sessions.middleware.SessionMiddleware` 已经修改,不再" "创建空的会话记录,即使 :setting:`SESSION_SAVE_EVERY_REQUEST` 处于活动状态也是" "如此。" msgid "" "Additionally, the ``contrib.sessions.backends.base.SessionBase.flush()`` and " "``cache_db.SessionStore.flush()`` methods have been modified to avoid " "creating a new empty session. Maintainers of third-party session backends " "should check if the same vulnerability is present in their backend and " "correct it if so." msgstr "" "此外,``contrib.sessions.backends.base.SessionBase.flush()`` 和 ``cache_db." "SessionStore.flush()`` 方法已经修改,以避免创建新的空会话。第三方会话后端的维" "护者应检查他们的后端是否存在相同的漏洞,如果是的话,应该进行修复。" msgid "Django 1.4.3 release notes" msgstr "Django 1.4.3 版本发行说明" msgid "" "Django 1.4.3 addresses two security issues present in previous Django " "releases in the 1.4 series." msgstr "Django 1.4.3 解决了 1.4 系列中之前 Django 版本存在的两个安全问题。" msgid "Django 1.4.4 release notes" msgstr "Django 1.4.4 版本发行说明" msgid "" "Django 1.4.4 fixes four security issues present in previous Django releases " "in the 1.4 series, as well as several other bugs and numerous documentation " "improvements." msgstr "" "Django 1.4.4 修复了 1.4 系列中之前 Django 版本存在的四个安全问题,以及其他一" "些错误和大量文档改进。" msgid "This is the fourth bugfix/security release in the Django 1.4 series." msgstr "这是 Django 1.4 系列中的第四个错误修复/安全更新版本。" msgid "" "For this reason, Django 1.4.4 adds a new setting, ``ALLOWED_HOSTS``, " "containing an explicit list of valid host/domain names for this site. A " "request with a Host header not matching an entry in this list will raise " "``SuspiciousOperation`` if ``request.get_host()`` is called. For full " "details see the documentation for the :setting:`ALLOWED_HOSTS` setting." msgstr "" "因此,Django 1.4.4 添加了一个新的设置,名为 ``ALLOWED_HOSTS``,其中包含了此站" "点的有效主机/域名的明确列表。如果请求的 Host 标头与此列表中的条目不匹配,那么" "如果调用了 ``request.get_host()``,将引发 ``SuspiciousOperation``。有关详细信" "息,请参阅 :setting:`ALLOWED_HOSTS` 设置的文档。" msgid "" "The default value for this setting in Django 1.4.4 is ``['*']`` (matching " "any host), for backwards-compatibility, but we strongly encourage all sites " "to set a more restrictive value." msgstr "" "Django 1.4.4 中此设置的默认值是 ``['*']`` (匹配任何主机),出于向后兼容性考" "虑,但我们强烈建议所有站点设置一个更为限制性的值。" msgid "" "The XML parser in the Python standard library is vulnerable to a number of " "attacks via external entities and entity expansion. Django uses this parser " "for deserializing XML-formatted database fixtures. This deserializer is not " "intended for use with untrusted data, but in order to err on the side of " "safety in Django 1.4.4 the XML deserializer refuses to parse an XML document " "with a DTD (DOCTYPE definition), which closes off these attack avenues." msgstr "" "Python 标准库中的 XML 解析器容易受到外部实体和实体扩展攻击。 Django 使用此解" "析器对 XML 格式的数据库固件进行反序列化。这个反序列化器并不是为了处理不可信数" "据而设计的,但为了在 Django 1.4.4 中确保安全,XML 反序列化器拒绝解析带有 DTD" "(DOCTYPE 定义)的 XML 文档,从而阻止了这些攻击途径。" msgid "" "In Django 1.4.4, all formsets have a strictly-enforced maximum number of " "forms (1000 by default, though it can be set higher via the ``max_num`` " "formset factory argument)." msgstr "" "在 Django 1.4.4 中,所有表单集都有一个严格执行的最大表单数限制(默认为 1000," "尽管可以通过表单集工厂参数 ``max_num`` 设置更高的值)。" msgid "" "In previous versions of Django, an admin user without change permission on a " "model could still view the Unicode representation of instances via their " "admin history log. Django 1.4.4 now limits the admin history log view for an " "object to users with change permission for that model." msgstr "" "在以前的 Django 版本中,没有模型更改权限的管理员用户仍然可以通过其管理历史记" "录查看实例的 Unicode 表示。现在,Django 1.4.4 将对象的管理历史记录视图限制为" "具有该模型更改权限的用户。" msgid "" "Prevented transaction state from leaking from one request to the next " "(#19707)." msgstr "防止事务状态从一个请求泄露到下一个请求( #19707 )。" msgid "Changed an SQL command syntax to be MySQL 4 compatible (#19702)." msgstr "更改了 SQL 命令语法以实现 MySQL 4 兼容性( #19702 )。" msgid "Added backwards-compatibility with old unsalted MD5 passwords (#18144)." msgstr "增加了对旧版未加盐 MD5 密码的向后兼容性( #18144 )。" msgid "Django 1.4.5 release notes" msgstr "Django 1.4.5 版本发行说明" msgid "" "Django 1.4.5 corrects a packaging problem with yesterday's :doc:`1.4.4 " "release `." msgstr "" "Django 1.4.5 修复了昨天发布的 :doc:`1.4.4 版本 ` 中的打包问" "题。" msgid "Django 1.4.6 release notes" msgstr "Django 1.4.6 版本发行说明" msgid "*August 13, 2013*" msgstr "*2013 年 8 月 13 日*" msgid "" "Django 1.4.6 fixes one security issue present in previous Django releases in " "the 1.4 series, as well as one other bug." msgstr "" "Django 1.4.6 修复了 1.4 系列中之前 Django 版本存在的一个安全问题,以及另一个" "错误。" msgid "This is the sixth bugfix/security release in the Django 1.4 series." msgstr "这是 Django 1.4 系列中的第六个错误修复/安全发布。" msgid "" "Django relies on user input in some cases (e.g. ``django.contrib.auth.views." "login()``, ``django.contrib.comments``, and :doc:`i18n `) to redirect the user to an \"on success\" URL. The security checks " "for these redirects (namely ``django.utils.http.is_safe_url()``) didn't " "check if the scheme is ``http(s)`` and as such allowed ``javascript:...`` " "URLs to be entered. If a developer relied on ``is_safe_url()`` to provide " "safe redirect targets and put such a URL into a link, they could suffer from " "a XSS attack. This bug doesn't affect Django currently, since we only put " "this URL into the ``Location`` response header and browsers seem to ignore " "JavaScript there." msgstr "" "Django 在某些情况下(例如,``django.contrib.auth.views.login()``、``django." "contrib.comments`` 和 :doc:`i18n `)依赖于用户输入来将用" "户重定向到“成功”URL。这些重定向的安全检查(即 ``django.utils.http." "is_safe_url()``)没有检查 URL 的协议是否为 ``http(s)``,因此允许输入 " "``javascript:...`` 类型的 URL。如果开发人员依赖于 ``is_safe_url()`` 来提供安" "全的重定向目标,并将这样的 URL 放入链接中,他们可能会受到 XSS 攻击的影响。当" "前情况下,这个错误不会影响 Django,因为我们只将这个 URL 放入 ``Location`` 响" "应头中,而浏览器似乎会忽略其中的 JavaScript。" msgid "" "Fixed an obscure bug with the :func:`~django.test.override_settings` " "decorator. If you hit an ``AttributeError: 'Settings' object has no " "attribute '_original_allowed_hosts'`` exception, it's probably fixed " "(#20636)." msgstr "" "修复了 :func:`~django.test.override_settings` 装饰器的一个晦涩 Bug。如果你遇" "到了 ``AttributeError: 'Settings' object has no attribute " "'_original_allowed_hosts'`` 异常,那么这个问题可能已经修复了(#20636)。" msgid "Django 1.4.7 release notes" msgstr "Django 1.4.7 版本发行说明" msgid "*September 10, 2013*" msgstr "*2013 年 9 月 10 日*" msgid "" "Django 1.4.7 fixes one security issue present in previous Django releases in " "the 1.4 series." msgstr "Django 1.4.7 修复了 1.4 系列中之前 Django 版本存在的一个安全问题。" msgid "Directory traversal vulnerability in ``ssi`` template tag" msgstr "``ssi`` 模板标签中的目录遍历漏洞" msgid "" "In previous versions of Django it was possible to bypass the " "``ALLOWED_INCLUDE_ROOTS`` setting used for security with the ``ssi`` " "template tag by specifying a relative path that starts with one of the " "allowed roots. For example, if ``ALLOWED_INCLUDE_ROOTS = (\"/var/www\",)`` " "the following would be possible:" msgstr "" "在以前的 Django 版本中,可以通过指定以允许的根目录之一开头的相对路径来绕过 " "``ssi`` 模板标签用于安全性的 ``ALLOWED_INCLUDE_ROOTS`` 设置。例如,如果 " "``ALLOWED_INCLUDE_ROOTS = (\"/var/www\",)``,那么以下情况是可能的:" msgid "" "In practice this is not a very common problem, as it would require the " "template author to put the ``ssi`` file in a user-controlled variable, but " "it's possible in principle." msgstr "" "实际上,这并不是一个非常常见的问题,因为它需要模板作者将 ``ssi`` 文件放入用户" "可控制的变量中,但从原理上讲是可能的。" msgid "Django 1.4.8 release notes" msgstr "Django 1.4.8 版本发行说明" msgid "*September 14, 2013*" msgstr "*2013 年 9 月 14 日*" msgid "" "Django 1.4.8 fixes two security issues present in previous Django releases " "in the 1.4 series." msgstr "Django 1.4.8 修复了 1.4 系列中之前 Django 版本存在的两个安全问题。" msgid "Denial-of-service via password hashers" msgstr "通过密码哈希器实现拒绝服务攻击" msgid "" "In previous versions of Django, no limit was imposed on the plaintext length " "of a password. This allowed a denial-of-service attack through submission of " "bogus but extremely large passwords, tying up server resources performing " "the (expensive, and increasingly expensive with the length of the password) " "calculation of the corresponding hash." msgstr "" "在以前的 Django 版本中,没有对密码明文长度施加限制。这允许通过提交虚假但极大" "的密码进行拒绝服务攻击,耗费服务器资源执行相应散列的计算(随着密码长度的增" "加,计算越来越昂贵)。" msgid "" "As of 1.4.8, Django's authentication framework imposes a 4096-byte limit on " "passwords and will fail authentication with any submitted password of " "greater length." msgstr "" "从 1.4.8 开始,Django 的身份验证框架对密码施加了 4096 字节的限制,并且对于提" "交的长度超过此限制的密码将无法进行身份验证。" msgid "" "Corrected usage of :func:`~django.views.decorators.debug." "sensitive_post_parameters` in :mod:`django.contrib.auth`’s admin" msgstr "" "在 :mod:`django.contrib.auth` 的管理员界面中,修正了对 :func:`~django.views." "decorators.debug.sensitive_post_parameters` 的使用" msgid "" "The decoration of the ``add_view`` and ``user_change_password`` user admin " "views with :func:`~django.views.decorators.debug.sensitive_post_parameters` " "did not include :func:`~django.utils.decorators.method_decorator` (required " "since the views are methods) resulting in the decorator not being properly " "applied. This usage has been fixed and :func:`~django.views.decorators.debug." "sensitive_post_parameters` will now throw an exception if it's improperly " "used." msgstr "" "对 ``add_view`` 和 ``user_change_password`` 用户管理视图的装饰使用 :func:" "`~django.views.decorators.debug.sensitive_post_parameters` 时没有包括 :func:" "`~django.utils.decorators.method_decorator` (因为这些视图是方法),导致装饰" "器未正确应用。这个使用已经被修复,现在如果不正确使用 :func:`~django.views." "decorators.debug.sensitive_post_parameters`,将引发异常。" msgid "Django 1.4.9 release notes" msgstr "Django 1.4.9 版本发行说明" msgid "*October 23, 2013*" msgstr "*2013 年 10 月 23 日*" msgid "" "Django 1.4.9 fixes a security-related bug in the 1.4 series and one other " "data corruption bug." msgstr "" "Django 1.4.9 修复了 1.4 系列中的一个与安全相关的错误以及另一个数据损坏错误。" msgid "Readdressed denial-of-service via password hashers" msgstr "重新解决通过密码哈希器实现的拒绝服务攻击问题" msgid "" "Django 1.4.8 imposes a 4096-byte limit on passwords in order to mitigate a " "denial-of-service attack through submission of bogus but extremely large " "passwords. In Django 1.4.9, we've reverted this change and instead improved " "the speed of our PBKDF2 algorithm by not rehashing the key on every " "iteration." msgstr "" "Django 1.4.8 对密码施加了 4096 字节的限制,以减轻通过提交虚假但极大的密码进行" "拒绝服务攻击的风险。在 Django 1.4.9 中,我们撤销了这个更改,而是通过在每次迭" "代时不重新哈希密钥来提高 PBKDF2 算法的速度。" msgid "" "Fixed a data corruption bug with ``datetime_safe.datetime.combine`` (#21256)." msgstr "修复了 ``datetime_safe.datetime.combine`` 的数据损坏 Bug (#21256)。" msgid "Django 1.5 release notes" msgstr "Django 1.5 版本发行说明" msgid "*February 26, 2013*" msgstr "*2013 年 2 月 26 日*" msgid "Welcome to Django 1.5!" msgstr "欢迎来到 Django 1.5 !" msgid "" "These release notes cover the :ref:`new features `, as well " "as some :ref:`backwards incompatible changes ` " "you'll want to be aware of when upgrading from Django 1.4 or older versions. " "We've also dropped some features, which are detailed in :ref:`our " "deprecation plan `, and we've :ref:`begun the " "deprecation process for some features `." msgstr "" "这些发布说明涵盖了 :ref:`新功能 `,以及从 Django 1.4 或更早版" "本升级时需要注意的一些 :ref:`不兼容的变化 `。我们" "还删除了一些功能,详细信息请参阅 :ref:`我们的弃用计划 `,并且我们已经 :ref:`开始了某些功能的弃用过程 `。" msgid "" "The biggest new feature in Django 1.5 is the `configurable User model`_. " "Before Django 1.5, applications that wanted to use Django's auth framework (:" "mod:`django.contrib.auth`) were forced to use Django's definition of a " "\"user\". In Django 1.5, you can now swap out the ``User`` model for one " "that you write yourself. This could be a simple extension to the existing " "``User`` model -- for example, you could add a Twitter or Facebook ID field " "-- or you could completely replace the ``User`` with one totally customized " "for your site." msgstr "" "Django 1.5 中最重要的新功能是 `可配置的用户模型`_。在 Django 1.5 之前,希望使" "用 Django 的身份验证框架(:mod:`django.contrib.auth`)的应用程序被强制使用 " "Django 对 \"用户\" 的定义。在 Django 1.5 中,现在可以将 ``User`` 模型替换为自" "己编写的模型。这可以是对现有 ``User`` 模型的简单扩展,例如,您可以添加 " "Twitter 或 Facebook ID 字段,或者您可以完全替换 ``User``,使用完全为您的站点" "定制的模型。" msgid "" "Django 1.5 is also the first release with `Python 3 support`_! We're " "labeling this support \"experimental\" because we don't yet consider it " "production-ready, but everything's in place for you to start porting your " "apps to Python 3. Our next release, Django 1.6, will support Python 3 " "without reservations." msgstr "" "Django 1.5 也是第一个支持 `Python 3`_ 的版本!我们将此支持标记为 \"实验性\"," "因为我们还不认为它已经可以用于生产环境,但已经为您提供了开始将您的应用程序移" "植到 Python 3 的一切必要条件。我们的下一个发布版,Django 1.6,将完全支持 " "Python 3,没有任何限制。" msgid "Other notable new features in Django 1.5 include:" msgstr "Django 1.5 中其他值得注意的新功能包括:" msgid "" "`Support for saving a subset of model's fields`_ - :meth:`Model.save() " "` now accepts an ``update_fields`` argument, " "letting you specify which fields are written back to the database when you " "call ``save()``. This can help in high-concurrency operations, and can " "improve performance." msgstr "" "`保存模型字段的子集支持`_ - :meth:`Model.save() ` 现在接受一个 ``update_fields`` 参数,允许您在调用 ``save()`` 时指定" "要写回数据库的字段。这对于高并发操作和性能优化非常有帮助。" msgid "" "Better `support for streaming responses <#explicit-streaming-responses>`_ " "via the new :class:`~django.http.StreamingHttpResponse` response class." msgstr "" "通过新的 :class:`~django.http.StreamingHttpResponse` 响应类,更好地支持 `流式" "响应 <#explicit-streaming-responses>`_。" msgid "`GeoDjango`_ now supports PostGIS 2.0." msgstr "`GeoDjango`_ 现在支持 PostGIS 2.0。" msgid "... and more; `see below <#what-s-new-in-django-1-5>`_." msgstr "... 还有更多; `请参见下面 <#what-s-new-in-django-1-5>`_。" msgid "" "Wherever possible we try to introduce new features in a backwards-compatible " "manner per :doc:`our API stability policy `. However, " "as with previous releases, Django 1.5 ships with some minor :ref:`backwards " "incompatible changes `; people upgrading from " "previous versions of Django should read that list carefully." msgstr "" "我们尽量在符合 :doc:`API 稳定政策 ` 的情况下引入新功能。" "然而,与以前的版本一样,Django 1.5 也包含一些轻微的 :ref:`不兼容变更 " "`;从以前版本的 Django 升级的用户应该仔细阅读该列" "表。" msgid "" "One deprecated feature worth noting is the shift to \"new-style\" :ttag:" "`url` tag. Prior to Django 1.3, syntax like ``{% url myview %}`` was " "interpreted incorrectly (Django considered ``\"myview\"`` to be a literal " "name of a view, not a template variable named ``myview``). Django 1.3 and " "above introduced the ``{% load url from future %}`` syntax to bring in the " "corrected behavior where ``myview`` was seen as a variable." msgstr "" "一个已经弃用的特性值得注意的是转向“新风格” :ttag:`url` 标记。在 Django 1.3 之" "前,类似 ``{% url myview %}`` 的语法被错误地解释(Django 将 ``\"myview\"`` 视" "为一个视图的字面名称,而不是一个名为 ``myview`` 的模板变量)。Django 1.3 及以" "上版本引入了 ``{% load url from future %}`` 的语法,以引入已修正的行为,其中 " "``myview`` 被视为一个变量。" msgid "" "The upshot of this is that if you are not using ``{% load url from future %}" "`` in your templates, you'll need to change tags like ``{% url myview %}`` " "to ``{% url \"myview\" %}``. If you *were* using ``{% load url from future %}" "`` you can simply remove that line under Django 1.5" msgstr "" "这个要点是,如果你的模板中没有使用 ``{% load url from future %}``,你需要将类" "似 ``{% url myview %}`` 这样的标记更改为 ``{% url \"myview\" %}``。如果你 *曾" "经* 使用了 ``{% load url from future %}``,在 Django 1.5 及以上版本中,你可以" "简单地删除那行代码。" msgid "" "Django 1.5 requires Python 2.6.5 or above, though we **highly recommend** " "Python 2.7.3 or above. Support for Python 2.5 and below has been dropped." msgstr "" "Django 1.5 要求使用 Python 2.6.5 或更高版本,但我们 **强烈建议** 使用 Python " "2.7.3 或更高版本。不再支持 Python 2.5 及以下版本。" msgid "" "This change should affect only a small number of Django users, as most " "operating-system vendors today are shipping Python 2.6 or newer as their " "default version. If you're still using Python 2.5, however, you'll need to " "stick to Django 1.4 until you can upgrade your Python version. Per :doc:`our " "support policy `, Django 1.4 will continue to " "receive security support until the release of Django 1.6." msgstr "" "这个变化应该只影响少数 Django 用户,因为今天大多数操作系统供应商默认安装 " "Python 2.6 或更新版本。然而,如果你仍在使用 Python 2.5,你需要继续使用 " "Django 1.4,直到你可以升级到支持的 Python 版本。根据 :doc:`我们的支持政策 `,Django 1.4 将在 Django 1.6 发布之前继续获得安全" "支持。" msgid "" "Django 1.5 does not run on a Jython final release, because Jython's latest " "release doesn't currently support Python 2.6. However, Jython currently does " "offer an alpha release featuring 2.7 support, and Django 1.5 supports that " "alpha release." msgstr "" "Django 1.5 无法在 Jython 的最终版本上运行,因为 Jython 的最新版本目前不支持 " "Python 2.6 。然而,Jython 目前确实提供了一个具有 2.7 支持的 alpha 版本,而 " "Django 1.5 支持该 alpha 版本。" msgid "Python 3 support" msgstr "Python 3 支持" msgid "" "Django 1.5 introduces support for Python 3 - specifically, Python 3.2 and " "above. This comes in the form of a **single** codebase; you don't need to " "install a different version of Django on Python 3. This means that you can " "write applications targeted for just Python 2, just Python 3, or single " "applications that support both platforms." msgstr "" "Django 1.5 引入了对 Python 3 的支持 - 具体而言,是 Python 3.2 及以上版本。这" "以 **单一** 代码库的形式呈现;你不需要在 Python 3 上安装不同版本的 Django。这" "意味着你可以编写针对仅 Python 2、仅 Python 3 或同时支持两个平台的单一应用程" "序。" msgid "" "However, we're labeling this support \"experimental\" for now: although it's " "received extensive testing via our automated test suite, it's received very " "little real-world testing. We've done our best to eliminate bugs, but we " "can't be sure we covered all possible uses of Django." msgstr "" "然而,我们现在将这种支持标记为“实验性”的:尽管它通过我们的自动化测试套件接受" "了广泛的测试,但在现实世界中的测试非常少。我们已尽最大努力消除错误,但不能确" "保涵盖了 Django 的所有可能用途。" msgid "" "Some features of Django aren't available because they depend on third-party " "software that hasn't been ported to Python 3 yet, including:" msgstr "" "由于某些功能依赖尚未移植到 Python 3 的第三方软件,因此 Django 的部分功能无法" "使用,包括:" msgid "the MySQL database backend (depends on MySQLdb)" msgstr "MySQL 数据库后端(依赖于 MySQLdb)" msgid ":class:`~django.db.models.ImageField` (depends on PIL)" msgstr ":class:`~django.db.models.ImageField` (依赖于 PIL)" msgid "" ":class:`~django.test.LiveServerTestCase` (depends on Selenium WebDriver)" msgstr ":class:`~django.test.LiveServerTestCase` (依赖于 Selenium WebDriver)" msgid "" "Further, Django's more than a web framework; it's an ecosystem of pluggable " "components. At this point, very few third-party applications have been " "ported to Python 3, so it's unlikely that a real-world application will have " "all its dependencies satisfied under Python 3." msgstr "" "此外,Django 不仅仅是一个 Web 框架;它还是一个可插拔组件的生态系统。目前,很" "少有第三方应用程序已移植到 Python 3,因此现实世界中的应用程序在 Python 3 下满" "足所有依赖关系的可能性很小。" msgid "" "Thus, we're recommending that Django 1.5 not be used in production under " "Python 3. Instead, use this opportunity to begin porting applications to " "Python 3. If you're an author of a pluggable component, we encourage you to " "start porting now." msgstr "" "因此,我们建议不要在 Python 3 下使用 Django 1.5 进行生产。相反,借此机会开始" "将应用程序移植到 Python 3 。如果您是一个可插拔组件的作者,我们鼓励您现在开始" "移植。" msgid "" "We plan to offer first-class, production-ready support for Python 3 in our " "next release, Django 1.6." msgstr "" "我们计划在下一个版本 Django 1.6 中为 Python 3 提供一流的、生产就绪的支持。" msgid "What's new in Django 1.5" msgstr "Django 1.5 中的新功能" msgid "Configurable User model" msgstr "可配置的用户模型" msgid "" "In Django 1.5, you can now use your own model as the store for user-related " "data. If your project needs a username with more than 30 characters, or if " "you want to store user's names in a format other than first name/last name, " "or you want to put custom profile information onto your User object, you can " "now do so." msgstr "" "在 Django 1.5 中,您现在可以使用自己的模型作为存储用户相关数据的存储。如果您" "的项目需要一个超过 30 个字符的用户名,或者您想要以除姓/名之外的格式存储用户的" "名字,或者您想要将自定义的个人资料信息添加到您的用户对象上,您现在可以这样" "做。" msgid "" "If you have a third-party reusable application that references the User " "model, you may need to make some changes to the way you reference User " "instances. You should also document any specific features of the User model " "that your application relies upon." msgstr "" "如果您有一个引用 User 模型的第三方可重用应用程序,您可能需要对引用 User 实例" "的方式进行一些更改。您还应记录您的应用程序所依赖的 User 模型的任何特定功能。" msgid "" "See the :ref:`documentation on custom user models ` for " "more details." msgstr "" "请查看 :ref:`自定义用户模型的文档 ` 以获取更多详细信息。" msgid "Support for saving a subset of model's fields" msgstr "支持保存模型字段的子集" msgid "" "The method :meth:`Model.save() ` has a new " "keyword argument ``update_fields``. By using this argument it is possible to " "save only a select list of model's fields. This can be useful for " "performance reasons or when trying to avoid overwriting concurrent changes." msgstr "" "方法 :meth:`Model.save() ` 现在有一个新的关键" "字参数 ``update_fields``。通过使用这个参数,可以仅保存模型字段的选择列表。这" "在性能方面或在尝试避免覆盖并发更改时可能很有用。" msgid "" "Deferred instances (those loaded by ``.only()`` or ``.defer()``) will " "automatically save just the loaded fields. If any field is set manually " "after load, that field will also get updated on save." msgstr "" "被延迟加载的实例(通过 ``.only()`` 或 ``.defer()`` 加载的实例)将自动保存仅加" "载的字段。如果在加载后手动设置了任何字段,这些字段在保存时也将得到更新。" msgid "" "See the :meth:`Model.save() ` documentation " "for more details." msgstr "" "请查看 :meth:`Model.save() ` 的文档以获取更多" "详细信息。" msgid "Caching of related model instances" msgstr "缓存相关模型实例" msgid "" "When traversing relations, the ORM will avoid re-fetching objects that were " "previously loaded. For example, with the tutorial's models:" msgstr "" "在遍历关系时,ORM 将避免重新获取之前已加载的对象。例如,使用教程中的模型:" msgid "" "In Django 1.5, the third line no longer triggers a new SQL query to fetch " "``first_choice.poll``; it was set by the second line." msgstr "" "在 Django 1.5 中,第三行不再触发新的 SQL 查询来获取 ``first_choice.poll``;它" "已经由第二行设置了。" msgid "" "For one-to-one relationships, both sides can be cached. For many-to-one " "relationships, only the single side of the relationship can be cached. This " "is particularly helpful in combination with ``prefetch_related``." msgstr "" "对于一对一关系,双方都可以被缓存。对于多对一关系,只能缓存关系的单一一方。这" "在与 ``prefetch_related`` 结合使用时特别有帮助。" msgid "Explicit support for streaming responses" msgstr "明确支持流式响应" msgid "" "Before Django 1.5, it was possible to create a streaming response by passing " "an iterator to :class:`~django.http.HttpResponse`. But this was unreliable: " "any middleware that accessed the :attr:`~django.http.HttpResponse.content` " "attribute would consume the iterator prematurely." msgstr "" "在 Django 1.5 之前,可以通过将迭代器传递给 :class:`~django.http." "HttpResponse` 来创建流式响应。但这是不可靠的:任何访问 :attr:`~django.http." "HttpResponse.content` 属性的中间件都会提前消耗迭代器。" msgid "" "You can now explicitly generate a streaming response with the new :class:" "`~django.http.StreamingHttpResponse` class. This class exposes a :class:" "`~django.http.StreamingHttpResponse.streaming_content` attribute which is an " "iterator." msgstr "" "现在,你可以使用新的 :class:`~django.http.StreamingHttpResponse` 类明确生成流" "式响应。这个类公开了一个 :class:`~django.http.StreamingHttpResponse." "streaming_content` 属性,它是一个迭代器。" msgid "" "Since :class:`~django.http.StreamingHttpResponse` does not have a " "``content`` attribute, middleware that needs access to the response content " "must test for streaming responses and behave accordingly." msgstr "" "由于 :class:`~django.http.StreamingHttpResponse` 没有 ``content`` 属性,需要" "访问响应内容的中间件必须检测流式响应并相应地处理。" msgid "``{% verbatim %}`` template tag" msgstr "``{% verbatim %}`` 模板标签" msgid "" "To make it easier to deal with JavaScript templates which collide with " "Django's syntax, you can now use the :ttag:`verbatim` block tag to avoid " "parsing the tag's content." msgstr "" "为了更轻松地处理与 Django 语法冲突的 JavaScript 模板,你现在可以使用 :ttag:" "`verbatim` 块标签来避免解析标签的内容。" msgid "Retrieval of ``ContentType`` instances associated with proxy models" msgstr "检索与代理模型相关联的 ``ContentType`` 实例" msgid "" "The methods :meth:`ContentTypeManager.get_for_model() ` and :meth:" "`ContentTypeManager.get_for_models() ` have a new keyword argument – " "respectively ``for_concrete_model`` and ``for_concrete_models``. By passing " "``False`` using this argument it is now possible to retrieve the :class:" "`ContentType ` associated " "with proxy models." msgstr "" "方法 :meth:`ContentTypeManager.get_for_model() ` 和 :meth:`ContentTypeManager." "get_for_models() ` 现在有一个新的关键字参数,分别是 ``for_concrete_model`` " "和 ``for_concrete_models``。通过使用这个参数并传递 ``False``,现在可以检索与" "代理模型相关联的 :class:`ContentType `。" msgid "New ``view`` variable in class-based views context" msgstr "类基视图上下文中的新变量 ``view``" msgid "" "In all :doc:`generic class-based views ` " "(or any class-based view inheriting from ``ContextMixin``), the context " "dictionary contains a ``view`` variable that points to the ``View`` instance." msgstr "" "在所有 :doc:`通用类基视图 ` (或继承自 " "``ContextMixin`` 的任何类基视图)中,上下文字典包含一个指向 ``View`` 实例的 " "``view`` 变量。" msgid "" ":class:`~django.contrib.gis.geos.LineString` and :class:`~django.contrib.gis." "geos.MultiLineString` GEOS objects now support the :meth:`~django.contrib." "gis.geos.GEOSGeometry.interpolate()` and :meth:`~django.contrib.gis.geos." "GEOSGeometry.project()` methods (so-called linear referencing)." msgstr "" ":class:`~django.contrib.gis.geos.LineString` 和 :class:`~django.contrib.gis." "geos.MultiLineString` GEOS 对象现在支持 :meth:`~django.contrib.gis.geos." "GEOSGeometry.interpolate()` 和 :meth:`~django.contrib.gis.geos.GEOSGeometry." "project()` 方法(称为线性参考)。" msgid "" "The ``wkb`` and ``hex`` properties of :class:`~django.contrib.gis.geos." "GEOSGeometry` objects preserve the Z dimension." msgstr "" ":class:`~django.contrib.gis.geos.GEOSGeometry` 对象的 ``wkb`` 和 ``hex`` 属性" "保留了 Z 维度。" msgid "" "Support for PostGIS 2.0 has been added and support for GDAL < 1.5 has been " "dropped." msgstr "已添加对 PostGIS 2.0 的支持,并且已放弃对 GDAL < 1.5 的支持。" msgid "New tutorials" msgstr "新教程" msgid "" "Additions to the docs include a revamped :doc:`Tutorial 3` and a new :doc:`tutorial on testing`. A new " "section, \"Advanced Tutorials\", offers :doc:`How to write reusable apps ` as well as a step-by-step guide for new contributors " "in :doc:`Writing your first patch for Django `." msgstr "" "文档中的新内容包括全新的 :doc:`教程 3 ` 和新的 :doc:`测试" "教程 `。一个新的部分,\"高级教程\",提供了 :doc:`如何编写" "可重用应用程序 ` 以及新贡献者的逐步指南 :doc:`为 " "Django 编写你的第一个补丁 `。" msgid "Django 1.5 also includes several smaller improvements worth noting:" msgstr "Django 1.5 还包括一些值得注意的较小改进:" msgid "" "The template engine now interprets ``True``, ``False`` and ``None`` as the " "corresponding Python objects." msgstr "" "模板引擎现在将 ``True``、``False`` 和 ``None`` 解释为相应的 Python 对象。" msgid "" ":mod:`django.utils.timezone` provides a helper for converting aware " "datetimes between time zones. See :func:`~django.utils.timezone.localtime`." msgstr "" ":mod:`django.utils.timezone` 提供了一个帮助程序,用于在不同时区之间转换带有时" "区信息的日期时间。请查看 :func:`~django.utils.timezone.localtime`。" msgid "The generic views support OPTIONS requests." msgstr "通用视图支持 OPTIONS 请求。" msgid "" "Management commands do not raise ``SystemExit`` any more when called by code " "from :func:`~django.core.management.call_command`. Any exception raised by " "the command (mostly :exc:`~django.core.management.CommandError`) is " "propagated." msgstr "" "当通过 :func:`~django.core.management.call_command` 从代码中调用管理命令时," "管理命令不再引发 ``SystemExit``。任何由命令引发的异常(主要是 :exc:`~django." "core.management.CommandError`)将被传播。" msgid "" "Moreover, when you output errors or messages in your custom commands, you " "should now use ``self.stdout.write('message')`` and ``self.stderr." "write('error')`` (see the note on :ref:`management commands output " "`)." msgstr "" "此外,当在自定义命令中输出错误或消息时,现在应该使用 ``self.stdout." "write('message')`` 和 ``self.stderr.write('error')`` (参见 :ref:`管理命令输" "出 ` 中的说明)。" msgid "" "The :djadmin:`dumpdata` management command outputs one row at a time, " "preventing out-of-memory errors when dumping large datasets." msgstr "" ":djadmin:`dumpdata` 管理命令现在逐行输出数据,以防止在导出大型数据集时出现内" "存不足错误。" msgid "" "In the localflavor for Canada, ``pq`` was added to the acceptable codes for " "Quebec. It's an old abbreviation." msgstr "" "在加拿大的本地化中,已经添加了 ``pq`` 作为魁北克省的可接受缩写。这是一个旧的" "缩写。" msgid "" "The :ref:`receiver ` decorator is now able to " "connect to more than one signal by supplying a list of signals." msgstr "" ":ref:`receiver ` 装饰器现在可以通过提供一个信" "号列表来连接多个信号。" msgid "" "In the admin, you can now filter users by groups which they are members of." msgstr "在管理员界面中,您现在可以根据用户所属的群组来筛选用户。" msgid "" ":meth:`QuerySet.bulk_create() ` " "now has a batch_size argument. By default the batch_size is unlimited except " "for SQLite where single batch is limited so that 999 parameters per query " "isn't exceeded." msgstr "" ":meth:`QuerySet.bulk_create() ` " "现在具有一个 batch_size 参数。默认情况下,batch_size 是无限的,除了 SQLite," "其中单个批次受限,以确保不超过每个查询的 999 个参数。" msgid "" "The :setting:`LOGIN_URL` and :setting:`LOGIN_REDIRECT_URL` settings now also " "accept view function names and :ref:`named URL patterns `. This allows you to reduce configuration duplication. More " "information can be found in the :func:`~django.contrib.auth.decorators." "login_required` documentation." msgstr "" ":setting:`LOGIN_URL` 和 :setting:`LOGIN_REDIRECT_URL` 设置现在也接受视图函数" "名称和 :ref:`命名的 URL 模式 `。这允许您减少配置的重复。" "更多信息可以在 :func:`~django.contrib.auth.decorators.login_required` 文档中" "找到。" msgid "" "Django now provides a mod_wsgi :doc:`auth handler `." msgstr "" "Django 现在提供了一个 mod_wsgi :doc:`认证处理程序 `。" msgid "" "The :meth:`QuerySet.delete() ` and :" "meth:`Model.delete() ` can now take fast-" "path in some cases. The fast-path allows for less queries and less objects " "fetched into memory. See :meth:`QuerySet.delete() ` for details." msgstr "" "在某些情况下,:meth:`QuerySet.delete() ` 和 :meth:`Model.delete() ` 现在可以" "采用快速路径。快速路径可以减少查询和减少加载到内存中的对象。请查看 :meth:" "`QuerySet.delete() ` 以获取详细信息。" msgid "" "An instance of ``ResolverMatch`` is stored on the request as " "``resolver_match``." msgstr "" "一个 ``ResolverMatch`` 的实例被存储在请求上,命名为 ``resolver_match``。" msgid "" "By default, all logging messages reaching the ``django`` logger when :" "setting:`DEBUG` is ``True`` are sent to the console (unless you redefine the " "logger in your :setting:`LOGGING` setting)." msgstr "" "默认情况下,当 :setting:`DEBUG` 为 ``True`` 时,所有达到 ``django`` 日志器的" "日志消息都会发送到控制台(除非您在 :setting:`LOGGING` 设置中重新定义了日志" "器)。" msgid "" "When using :class:`~django.template.RequestContext`, it is now possible to " "look up permissions by using ``{% if 'someapp.someperm' in perms %}`` in " "templates." msgstr "" "在使用 :class:`~django.template.RequestContext` 时,现在可以在模板中使用 " "``{% if 'someapp.someperm' in perms %}`` 来查找权限。" msgid "" "It's not required any more to have ``404.html`` and ``500.html`` templates " "in the root templates directory. Django will output some basic error " "messages for both situations when those templates are not found. It's still " "recommended as good practice to provide those templates in order to present " "pretty error pages to the user." msgstr "" "不再需要在根模板目录中拥有 ``404.html`` 和 ``500.html`` 模板。当这些模板找不" "到时,Django 会输出一些基本的错误消息。仍然建议作为良好的实践提供这些模板,以" "便向用户呈现漂亮的错误页面。" msgid "" ":mod:`django.contrib.auth` provides a new signal that is emitted whenever a " "user fails to login successfully. See :data:`~django.contrib.auth.signals." "user_login_failed`" msgstr "" ":mod:`django.contrib.auth` 提供了一个新的信号,每当用户登录失败时都会发出该信" "号。请查看 :data:`~django.contrib.auth.signals.user_login_failed`。" msgid "" "The new :option:`loaddata --ignorenonexistent` option ignore data for fields " "that no longer exist." msgstr "" "新的 :option:`loaddata --ignorenonexistent` 选项会忽略不再存在的字段的数据。" msgid "" ":meth:`~django.test.SimpleTestCase.assertXMLEqual` and :meth:`~django.test." "SimpleTestCase.assertXMLNotEqual` new assertions allow you to test equality " "for XML content at a semantic level, without caring for syntax differences " "(spaces, attribute order, etc.)." msgstr "" ":meth:`~django.test.SimpleTestCase.assertXMLEqual` 和 :meth:`~django.test." "SimpleTestCase.assertXMLNotEqual` 这两个新的断言允许您在语义级别测试 XML 内容" "的相等性,而不必关心语法差异(空格、属性顺序等)。" msgid "" "RemoteUserMiddleware now forces logout when the REMOTE_USER header " "disappears during the same browser session." msgstr "" "当同一浏览器会话中的 REMOTE_USER 头消失时,RemoteUserMiddleware 现在会强制注" "销。" msgid "" "The :ref:`cache-based session backend ` can store " "session data in a non-default cache." msgstr "" "基于缓存的会话后端(:ref:`cache-based session backend `)可以将会话数据存储在非默认的缓存中。" msgid "" "Multi-column indexes can now be created on models. Read the :attr:`~django." "db.models.Options.index_together` documentation for more information." msgstr "" "现在可以在模型上创建多列索引。阅读 :attr:`~django.db.models.Options." "index_together` 文档以获取更多信息。" msgid "" "During Django's logging configuration verbose Deprecation warnings are " "enabled and warnings are captured into the logging system. Logged warnings " "are routed through the ``console`` logging handler, which by default " "requires :setting:`DEBUG` to be True for output to be generated. The result " "is that DeprecationWarnings should be printed to the console in development " "environments the way they have been in Python versions < 2.7." msgstr "" "在 Django 的日志配置中,详细的弃用警告被启用,并且警告被捕获到日志系统中。已" "记录的警告通过 ``console`` 日志处理程序路由,其默认情况下需要 :setting:" "`DEBUG` 为 True 才能生成输出。因此,在开发环境中,DeprecationWarnings 应该以" "与 Python 版本 < 2.7 中相同的方式打印到控制台。" msgid "" "The API for :meth:`django.contrib.admin.ModelAdmin.message_user` method has " "been modified to accept additional arguments adding capabilities similar to :" "func:`django.contrib.messages.add_message`. This is useful for generating " "error messages from admin actions." msgstr "" ":meth:`django.contrib.admin.ModelAdmin.message_user` 方法的 API 已经修改,以" "接受额外的参数,增加了类似于 :func:`django.contrib.messages.add_message` 的功" "能。这对于从管理操作生成错误消息非常有用。" msgid "" "The admin's list filters can now be customized per-request thanks to the " "new :meth:`django.contrib.admin.ModelAdmin.get_list_filter` method." msgstr "" "管理员的列表过滤器现在可以根据每个请求进行自定义,这要归功于新的 :meth:" "`django.contrib.admin.ModelAdmin.get_list_filter` 方法。" msgid "Backwards incompatible changes in 1.5" msgstr "1.5 中的向后不兼容更改" msgid "" "In addition to the changes outlined in this section, be sure to review the :" "ref:`deprecation plan ` for any features that " "have been removed. If you haven't updated your code within the deprecation " "timeline for a given feature, its removal may appear as a backwards " "incompatible change." msgstr "" "除了本节中概述的更改外,确保查看 :ref:`弃用计划 `,以了解已删除的任何功能。如果您没有在给定功能的弃用时间表内更新您的" "代码,其删除可能会被视为向后不兼容的更改。" msgid "``ALLOWED_HOSTS`` required in production" msgstr "在生产环境中必须设置 ``ALLOWED_HOSTS``" msgid "" "The new :setting:`ALLOWED_HOSTS` setting validates the request's ``Host`` " "header and protects against host-poisoning attacks. This setting is now " "required whenever :setting:`DEBUG` is ``False``, or else :meth:`django.http." "HttpRequest.get_host()` will raise :exc:`~django.core.exceptions." "SuspiciousOperation`. For more details see the :setting:`full " "documentation` for the new setting." msgstr "" "新的 :setting:`ALLOWED_HOSTS` 设置验证请求的 ``Host`` 头并保护免受主机投毒攻" "击。此设置现在在 :setting:`DEBUG` 为 ``False`` 时是必需的,否则 :meth:" "`django.http.HttpRequest.get_host()` 将引发 :exc:`~django.core.exceptions." "SuspiciousOperation`。更多详情请参阅新设置的 :setting:`完整文档 " "`。" msgid "Managers on abstract models" msgstr "抽象模型上的管理器" msgid "" "Abstract models are able to define a custom manager, and that manager :ref:" "`will be inherited by any concrete models extending the abstract model " "`. However, if you try to use the abstract " "model to call a method on the manager, an exception will now be raised. " "Previously, the call would have been permitted, but would have failed as " "soon as any database operation was attempted (usually with a \"table does " "not exist\" error from the database)." msgstr "" "抽象模型可以定义一个自定义管理器,并且该管理器 :ref:`将被任何扩展抽象模型的具" "体模型继承 `。然而,如果您尝试在抽象模型上调" "用管理器的方法,现在将会引发异常。以前,允许调用,但只要尝试进行任何数据库操" "作,通常会导致数据库报错 \"表不存在\"。" msgid "" "If you have functionality on a manager that you have been invoking using the " "abstract class, you should migrate that logic to a Python ``staticmethod`` " "or ``classmethod`` on the abstract class." msgstr "" "如果您在管理器上有功能,一直在使用抽象类进行调用,您应该将该逻辑迁移到抽象类" "上的 Python ``staticmethod`` 或 ``classmethod``。" msgid "Context in year archive class-based views" msgstr "基于类的年度归档视图中的上下文" msgid "" "For consistency with the other date-based generic views, :class:`~django." "views.generic.dates.YearArchiveView` now passes ``year`` in the context as " "a :class:`datetime.date` rather than a string. If you are using ``{{ year }}" "`` in your templates, you must replace it with ``{{ year|date:\"Y\" }}``." msgstr "" "为了与其他基于日期的通用视图保持一致,:class:`~django.views.generic.dates." "YearArchiveView` 现在将 ``year`` 作为一个 :class:`datetime.date` 而不是一个字" "符串传递给上下文。如果您在模板中使用了 ``{{ year }}``,您必须将其替换为 " "``{{ year|date:\"Y\" }}``。" msgid "" "``next_year`` and ``previous_year`` were also added in the context. They are " "calculated according to ``allow_empty`` and ``allow_future``." msgstr "" "``next_year`` 和 ``previous_year`` 也被添加到上下文中。它们根据 " "``allow_empty`` 和 ``allow_future`` 进行计算。" msgid "Context in year and month archive class-based views" msgstr "基于类的年度和月度归档视图中的上下文" msgid "" ":class:`~django.views.generic.dates.YearArchiveView` and :class:`~django." "views.generic.dates.MonthArchiveView` were documented to provide a " "``date_list`` sorted in ascending order in the context, like their function-" "based predecessors, but it actually was in descending order. In 1.5, the " "documented order was restored. You may want to add (or remove) the " "``reversed`` keyword when you're iterating on ``date_list`` in a template:" msgstr "" ":class:`~django.views.generic.dates.YearArchiveView` 和 :class:`~django." "views.generic.dates.MonthArchiveView` 的文档中曾经说明在上下文中提供一个按升" "序排序的 ``date_list``,就像它们的基于函数的前身一样,但实际上它是按降序排序" "的。在1.5版本中,文档中的顺序已经恢复。在模板中迭代 ``date_list`` 时,您可能" "需要添加(或删除) ``reversed`` 关键字:" msgid "" ":class:`~django.views.generic.dates.ArchiveIndexView` still provides a " "``date_list`` in descending order." msgstr "" ":class:`~django.views.generic.dates.ArchiveIndexView` 仍然以降序提供一个 " "``date_list``。" msgid "Context in TemplateView" msgstr "TemplateView 中的上下文" msgid "" "For consistency with the design of the other generic views, :class:`~django." "views.generic.base.TemplateView` no longer passes a ``params`` dictionary " "into the context, instead passing the variables from the URLconf directly " "into the context." msgstr "" "为了与其他通用视图的设计保持一致,:class:`~django.views.generic.base." "TemplateView` 不再将一个 ``params`` 字典传递到上下文中,而是直接将来自 " "URLconf 的变量传递到上下文中。" msgid "Non-form data in HTTP requests" msgstr "HTTP 请求中的非表单数据" msgid "" ":attr:`request.POST ` will no longer include " "data posted via HTTP requests with non form-specific content-types in the " "header. In prior versions, data posted with content-types other than :" "mimetype:`multipart/form-data` or :mimetype:`application/x-www-form-" "urlencoded` would still end up represented in the :attr:`request.POST " "` attribute. Developers wishing to access the " "raw POST data for these cases, should use the :attr:`request.body ` attribute instead." msgstr "" ":attr:`request.POST ` 将不再包含通过非表单特定" "内容类型的 HTTP 请求发布的数据。在以前的版本中,使用除 :mimetype:`multipart/" "form-data` 或 :mimetype:`application/x-www-form-urlencoded` 之外的内容类型发" "布的数据仍然会在 :attr:`request.POST ` 属性中表" "示出来。希望访问这些情况下的原始 POST 数据的开发人员应该使用 :attr:`request." "body ` 属性。" msgid ":data:`~django.core.signals.request_finished` signal" msgstr ":data:`~django.core.signals.request_finished` 信号" msgid "" "Django used to send the :data:`~django.core.signals.request_finished` signal " "as soon as the view function returned a response. This interacted badly " "with :ref:`streaming responses ` that delay content " "generation." msgstr "" "Django 曾经在视图函数返回响应后立即发送 :data:`~django.core.signals." "request_finished` 信号。这与延迟内容生成的 :ref:`流式响应 ` 产生了不良互动。" msgid "" "This signal is now sent after the content is fully consumed by the WSGI " "gateway. This might be backwards incompatible if you rely on the signal " "being fired before sending the response content to the client. If you do, " "you should consider using :doc:`middleware ` " "instead." msgstr "" "现在,该信号在内容被 WSGI 网关完全消耗后发送。如果您依赖于在将响应内容发送给" "客户端之前触发信号,这可能会导致不兼容。如果是这样,您应该考虑使用 :doc:`中间" "件 `。" msgid "" "Some WSGI servers and middleware do not always call ``close`` on the " "response object after handling a request, most notably uWSGI prior to 1.2.6 " "and Sentry's error reporting middleware up to 2.0.7. In those cases the " "``request_finished`` signal isn't sent at all. This can result in idle " "connections to database and memcache servers." msgstr "" "一些 WSGI 服务器和中间件在处理请求后并不总是调用响应对象的 ``close`` 方法,特" "别是在 1.2.6 之前的 uWSGI 和 Sentry 的错误报告中间件在 2.0.7 之前的版本中存在" "这个问题。在这些情况下,``request_finished`` 信号根本不会被发送。这可能导致数" "据库和内存缓存服务器上的空闲连接。" msgid "OPTIONS, PUT and DELETE requests in the test client" msgstr "测试客户端中的 OPTIONS 、 PUT 和 DELETE 请求" msgid "" "Unlike GET and POST, these HTTP methods aren't implemented by web browsers. " "Rather, they're used in APIs, which transfer data in various formats such as " "JSON or XML. Since such requests may contain arbitrary data, Django doesn't " "attempt to decode their body." msgstr "" "与 GET 和 POST 不同,这些 HTTP 方法并不由 Web 浏览器实现。相反,它们在 API 中" "使用,用于以各种格式(如 JSON 或 XML)传输数据。由于此类请求可能包含任意数" "据,Django 不会尝试解码其主体。" msgid "" "However, the test client used to build a query string for OPTIONS and DELETE " "requests like for GET, and a request body for PUT requests like for POST. " "This encoding was arbitrary and inconsistent with Django's behavior when it " "receives the requests, so it was removed in Django 1.5." msgstr "" "然而,用于构建 OPTIONS 和 DELETE 请求的测试客户端与 GET 请求一样构建查询字符" "串,而用于构建 PUT 请求的测试客户端与 POST 请求一样构建请求体。这种编码方式是" "任意的,并且与 Django 接收请求时的行为不一致,因此在 Django 1.5 中已被移除。" msgid "" "If you were using the ``data`` parameter in an OPTIONS or a DELETE request, " "you must convert it to a query string and append it to the ``path`` " "parameter." msgstr "" "如果您在 OPTIONS 或 DELETE 请求中使用了 ``data`` 参数,您必须将其转换为查询字" "符串并附加到 ``path`` 参数中。" msgid "" "If you were using the ``data`` parameter in a PUT request without a " "``content_type``, you must encode your data before passing it to the test " "client and set the ``content_type`` argument." msgstr "" "如果您在没有 ``content_type`` 的情况下在 PUT 请求中使用了 ``data`` 参数,您必" "须在将其传递给测试客户端之前对数据进行编码,并设置 ``content_type`` 参数。" msgid "System version of ``simplejson`` no longer used" msgstr "系统版本的 ``simplejson`` 不再使用" msgid "" ":ref:`As explained below `, Django 1.5 deprecates " "``django.utils.simplejson`` in favor of Python 2.6's built-in :mod:`json` " "module. In theory, this change is harmless. Unfortunately, because of " "incompatibilities between versions of ``simplejson``, it may trigger errors " "in some circumstances." msgstr "" "正如下文所解释的那样,Django 1.5 弃用了 ``django.utils.simplejson``,而推荐使" "用 Python 2.6 内置的 :mod:`json` 模块。理论上,这个更改是无害的。不幸的是,由" "于不同版本的 ``simplejson`` 之间的不兼容性,它可能在某些情况下触发错误。" msgid "" "JSON-related features in Django 1.4 always used ``django.utils.simplejson``. " "This module was actually:" msgstr "" "Django 1.4 中与 JSON 相关的功能始终使用了 ``django.utils.simplejson``。这个模" "块实际上是:" msgid "" "A system version of ``simplejson``, if one was available (i.e. ``import " "simplejson`` works), if it was more recent than Django's built-in copy or it " "had the C speedups, or" msgstr "" "如果有一个系统版本的 ``simplejson``,如果有的话(即 ``import simplejson`` 能" "正常工作),如果它比 Django 内置的版本更新,或者它具有 C 加速,或者" msgid "" "The :mod:`json` module from the standard library, if it was available (i.e. " "Python 2.6 or greater), or" msgstr "" "标准库中的 :mod:`json` 模块,如果可用(即 Python 2.6 或更高版本),或者" msgid "A built-in copy of version 2.0.7 of ``simplejson``." msgstr "一个内置版本的 ``simplejson``,版本号为 2.0.7。" msgid "" "In Django 1.5, those features use Python's :mod:`json` module, which is " "based on version 2.0.9 of ``simplejson``." msgstr "" "在 Django 1.5 中,这些功能使用了 Python 的 :mod:`json` 模块,该模块基于 " "``simplejson`` 版本 2.0.9。" msgid "" "There are no known incompatibilities between Django's copy of version 2.0.7 " "and Python's copy of version 2.0.9. However, there are some " "incompatibilities between other versions of ``simplejson``:" msgstr "" "目前没有已知的 Django 内置版本 2.0.7 与 Python 版本 2.0.9 之间的不兼容性。但" "是,其他版本的 ``simplejson`` 存在一些不兼容性:" msgid "" "While the ``simplejson`` API is documented as always returning Unicode " "strings, the optional C implementation can return a bytestring. This was " "fixed in Python 2.7." msgstr "" "虽然 ``simplejson`` 的 API 文档中始终说明返回 Unicode 字符串,但可选的 C 实现" "可以返回字节串。这个问题在 Python 2.7 中已经修复。" msgid "" "``simplejson.JSONEncoder`` gained a ``namedtuple_as_object`` keyword " "argument in version 2.2." msgstr "" "``simplejson.JSONEncoder`` 在版本 2.2 中新增了一个关键字参数 " "``namedtuple_as_object``。" msgid "" "More information on these incompatibilities is available in :ticket:`ticket " "#18023 <18023#comment:10>`." msgstr "" "有关这些不兼容性的更多信息可以在 :ticket:`ticket #18023 <18023#comment:10>` " "中找到。" msgid "" "The net result is that, if you have installed ``simplejson`` and your code " "uses Django's serialization internals directly -- for instance ``django.core." "serializers.json.DjangoJSONEncoder``, the switch from ``simplejson`` to :mod:" "`json` could break your code. (In general, changes to internals aren't " "documented; we're making an exception here.)" msgstr "" "总的来说,如果你安装了 ``simplejson`` 并且你的代码直接使用了 Django 的序列化" "内部,例如 ``django.core.serializers.json.DjangoJSONEncoder``,从 " "``simplejson`` 切换到 :mod:`json` 可能会破坏你的代码。(一般情况下,对内部的" "更改不会被记录在文档中;我们在这里做了一个例外。)" msgid "" "At this point, the maintainers of Django believe that using :mod:`json` from " "the standard library offers the strongest guarantee of backwards-" "compatibility. They recommend to use it from now on." msgstr "" "目前,Django 的维护者认为使用标准库中的 :mod:`json` 提供了最强的向后兼容性保" "证。他们建议从现在开始使用它。" msgid "String types of hasher method parameters" msgstr "哈希方法参数的字符串类型" msgid "" "If you have written a :ref:`custom password hasher `, " "your ``encode()``, ``verify()`` or ``safe_summary()`` methods should accept " "Unicode parameters (``password``, ``salt`` or ``encoded``). If any of the " "hashing methods need bytestrings, you can use the :func:`~django.utils." "encoding.force_bytes` utility to encode the strings." msgstr "" "如果你编写了一个自定义的密码哈希器(:ref:`自定义密码哈希器 " "`),你的 ``encode()``、``verify()`` 或 " "``safe_summary()`` 方法应该接受 Unicode 参数(``password``、``salt`` 或 " "``encoded``)。如果哈希方法中需要字节串,你可以使用 :func:`~django.utils." "encoding.force_bytes` 实用程序来编码字符串。" msgid "Validation of previous_page_number and next_page_number" msgstr "验证 previous_page_number 和 next_page_number" msgid "" "When using :doc:`object pagination `, the " "``previous_page_number()`` and ``next_page_number()`` methods of the :class:" "`~django.core.paginator.Page` object did not check if the returned number " "was inside the existing page range. It does check it now and raises an :exc:" "`~django.core.paginator.InvalidPage` exception when the number is either too " "low or too high." msgstr "" "在使用 :doc:`对象分页 ` 时,:class:`~django.core." "paginator.Page` 对象的 ``previous_page_number()`` 和 ``next_page_number()`` " "方法现在会检查返回的页码是否在现有的页面范围内。如果页码过低或过高,它们将引" "发 :exc:`~django.core.paginator.InvalidPage` 异常。" msgid "Behavior of autocommit database option on PostgreSQL changed" msgstr "PostgreSQL 中 autocommit 数据库选项的行为已更改" msgid "" "PostgreSQL's autocommit option didn't work as advertised previously. It did " "work for single transaction block, but after the first block was left the " "autocommit behavior was never restored. This bug is now fixed in 1.5. While " "this is only a bug fix, it is worth checking your applications behavior if " "you are using PostgreSQL together with the autocommit option." msgstr "" "PostgreSQL 的自动提交选项在以前的广告中没有按照预期工作。对于单个事务块确实有" "效,但是在第一个块结束后,自动提交行为没有被恢复。这个错误在 1.5 版本中已经修" "复。虽然这只是一个错误修复,但如果你正在使用 PostgreSQL 与自动提交选项,值得" "检查你的应用程序的行为。" msgid "Session not saved on 500 responses" msgstr "500 响应时会话未保存。" msgid "" "Django's session middleware will skip saving the session data if the " "response's status code is 500." msgstr "如果响应的状态码是 500,Django 的会话中间件将跳过保存会话数据。" msgid "Email checks on failed admin login" msgstr "管理员登录失败时进行电子邮件检查。" msgid "" "Prior to Django 1.5, if you attempted to log into the admin interface and " "mistakenly used your email address instead of your username, the admin " "interface would provide a warning advising that your email address was not " "your username. In Django 1.5, the introduction of :ref:`custom user models " "` has required the removal of this warning. This doesn't " "change the login behavior of the admin site; it only affects the warning " "message that is displayed under one particular mode of login failure." msgstr "" "在 Django 1.5 之前,如果您尝试登录到管理员界面并错误地使用电子邮件地址而不是" "用户名,管理员界面会提供警告,建议您的电子邮件地址不是用户名。在 Django 1.5 " "中,引入了 :ref:`自定义用户模型 `,需要删除此警告。这不会改" "变管理员站点的登录行为;它只影响在一种特定的登录失败模式下显示的警告消息。" msgid "Changes in tests execution" msgstr "测试执行的变化" msgid "" "Some changes have been introduced in the execution of tests that might be " "backward-incompatible for some testing setups:" msgstr "一些关于测试执行的变化已经引入,这可能对某些测试设置不兼容。" msgid "Database flushing in ``django.test.TransactionTestCase``" msgstr "在 ``django.test.TransactionTestCase`` 中进行数据库刷新操作" msgid "" "Previously, the test database was truncated *before* each test run in a :" "class:`~django.test.TransactionTestCase`." msgstr "" "在 :class:`~django.test.TransactionTestCase` 中,在每次测试运行之前对测试数据" "库进行截断操作。" msgid "" "In order to be able to run unit tests in any order and to make sure they are " "always isolated from each other, :class:`~django.test.TransactionTestCase` " "will now reset the database *after* each test run instead." msgstr "" "为了能够以任何顺序运行单元测试,并确保它们始终相互隔离,:class:`~django.test." "TransactionTestCase` 现在会在每次测试运行之后重置数据库。" msgid "No more implicit DB sequences reset" msgstr "不再隐式重置数据库序列" msgid "" ":class:`~django.test.TransactionTestCase` tests used to reset primary key " "sequences automatically together with the database flushing actions " "described above." msgstr "" ":class:`~django.test.TransactionTestCase` 测试过去会自动重置主键序列,以及上" "述描述的数据库刷新操作。" msgid "" "This has been changed so no sequences are implicitly reset. This can cause :" "class:`~django.test.TransactionTestCase` tests that depend on hard-coded " "primary key values to break." msgstr "" "这已经改变,所以不会隐式重置任何序列。这可能导致依赖于硬编码主键值的 :class:" "`~django.test.TransactionTestCase` 测试出现问题。" msgid "" "The new :attr:`~django.test.TransactionTestCase.reset_sequences` attribute " "can be used to force the old behavior for :class:`~django.test." "TransactionTestCase` that might need it." msgstr "" "新的 :attr:`~django.test.TransactionTestCase.reset_sequences` 属性可以用于强" "制对可能需要的 :class:`~django.test.TransactionTestCase` 使用旧的行为。" msgid "Ordering of tests" msgstr "测试的顺序" msgid "" "In order to make sure all ``TestCase`` code starts with a clean database, " "tests are now executed in the following order:" msgstr "" "为了确保所有的 ``TestCase`` 代码都从一个干净的数据库开始运行,测试现在按照以" "下顺序执行:" msgid "" "First, all unit tests (including :class:`unittest.TestCase`, :class:`~django." "test.SimpleTestCase`, :class:`~django.test.TestCase` and :class:`~django." "test.TransactionTestCase`) are run with no particular ordering guaranteed " "nor enforced among them." msgstr "" "首先,运行所有单元测试(包括 :class:`unittest.TestCase`、:class:`~django." "test.SimpleTestCase`、:class:`~django.test.TestCase` 和 :class:`~django.test." "TransactionTestCase`),它们之间没有特定的顺序保证或强制执行。" msgid "" "Then any other tests (e.g. doctests) that may alter the database without " "restoring it to its original state are run." msgstr "" "然后运行可能会更改数据库而不将其还原为原始状态的任何其他测试(例如 " "doctests)。" msgid "" "This should not cause any problems unless you have existing doctests which " "assume a :class:`~django.test.TransactionTestCase` executed earlier left " "some database state behind or unit tests that rely on some form of state " "being preserved after the execution of other tests. Such tests are already " "very fragile, and must now be changed to be able to run independently." msgstr "" "这不应该导致任何问题,除非你有一些现有的 doctests 假设之前执行过一个 :class:" "`~django.test.TransactionTestCase` 留下了一些数据库状态,或者单元测试依赖于在" "其他测试执行后保留某种状态。这样的测试已经非常脆弱,现在必须进行更改以能够独" "立运行。" msgid "``cleaned_data`` dictionary kept for invalid forms" msgstr "为无效表单保留的 ``cleaned_data`` 字典" msgid "" "The :attr:`~django.forms.Form.cleaned_data` dictionary is now always present " "after form validation. When the form doesn't validate, it contains only the " "fields that passed validation. You should test the success of the validation " "with the :meth:`~django.forms.Form.is_valid()` method and not with the " "presence or absence of the :attr:`~django.forms.Form.cleaned_data` attribute " "on the form." msgstr "" "现在,经过表单验证后,总是存在 :attr:`~django.forms.Form.cleaned_data` 字典。" "当表单未通过验证时,它仅包含通过验证的字段。您应该使用 :meth:`~django.forms." "Form.is_valid()` 方法来测试验证的成功与否,而不是通过表单上的 :attr:`~django." "forms.Form.cleaned_data` 属性的存在或缺失来判断。" msgid "Behavior of ``syncdb`` with multiple databases" msgstr "关于多个数据库的 ``syncdb`` 的行为" msgid "" "``syncdb`` now queries the database routers to determine if content types " "(when :mod:`~django.contrib.contenttypes` is enabled) and permissions (when :" "mod:`~django.contrib.auth` is enabled) should be created in the target " "database. Previously, it created them in the default database, even when " "another database was specified with the ``--database`` option." msgstr "" "现在,``syncdb`` 会查询数据库路由器,以确定在目标数据库中是否应创建内容类型" "(当启用 :mod:`~django.contrib.contenttypes` 时)和权限(当启用 :mod:" "`~django.contrib.auth` 时)。以前,即使使用 ``--database`` 选项指定了另一个数" "据库,它也会在默认数据库中创建它们。" msgid "" "If you use ``syncdb`` on multiple databases, you should ensure that your " "routers allow synchronizing content types and permissions to only one of " "them. See the docs on the :ref:`behavior of contrib apps with multiple " "databases ` for more information." msgstr "" "如果您在多个数据库上使用 ``syncdb``,应确保您的路由器只允许将内容类型和权限同" "步到其中一个数据库。有关更多信息,请参阅 :ref:`多数据库中的 contrib 应用程序" "行为 ` 的文档。" msgid "XML deserializer will not parse documents with a DTD" msgstr "XML 反序列化器不会解析带有 DTD 的文档。" msgid "" "In order to prevent exposure to denial-of-service attacks related to " "external entity references and entity expansion, the XML model deserializer " "now refuses to parse XML documents containing a DTD (DOCTYPE definition). " "Since the XML serializer does not output a DTD, this will not impact typical " "usage, only cases where custom-created XML documents are passed to Django's " "model deserializer." msgstr "" "为了防止与外部实体引用和实体扩展相关的拒绝服务攻击,XML 模型反序列化器现在拒" "绝解析包含 DTD(DOCTYPE 定义)的 XML 文档。由于 XML 序列化器不输出 DTD,这只" "会影响传递给 Django 模型反序列化器的自定义创建的 XML 文档,而不会影响典型的用" "法。" msgid "Formsets default ``max_num``" msgstr "Formsets 的默认 ``max_num`` 值" msgid "" "A (default) value of ``None`` for the ``max_num`` argument to a formset " "factory no longer defaults to allowing any number of forms in the formset. " "Instead, in order to prevent memory-exhaustion attacks, it now defaults to a " "limit of 1000 forms. This limit can be raised by explicitly setting a higher " "value for ``max_num``." msgstr "" "表单集工厂的 ``max_num`` 参数的默认值为 ``None`` 不再默认允许表单集中的任意数" "量的表单。相反,为了防止内存耗尽攻击,它现在默认为限制为 1000 个表单。可以通" "过显式设置更高的 ``max_num`` 值来提高此限制。" msgid "" ":class:`django.forms.ModelMultipleChoiceField` now returns an empty " "``QuerySet`` as the empty value instead of an empty list." msgstr "" ":class:`django.forms.ModelMultipleChoiceField` 现在将空的 ``QuerySet`` 作为空" "值返回,而不是空列表。" msgid "" ":func:`~django.utils.http.int_to_base36` properly raises a :exc:`TypeError` " "instead of :exc:`ValueError` for non-integer inputs." msgstr "" ":func:`~django.utils.http.int_to_base36` 对于非整数输入现在会正确引发 :exc:" "`TypeError`,而不是 :exc:`ValueError`。" msgid "" "The ``slugify`` template filter is now available as a standard Python " "function at :func:`django.utils.text.slugify`. Similarly, ``remove_tags`` is " "available at ``django.utils.html.remove_tags()``." msgstr "" "模板过滤器中的 ``slugify`` 现在作为标准的 Python 函数在 :func:`django.utils." "text.slugify` 中可用。同样,``remove_tags`` 在 ``django.utils.html." "remove_tags()`` 中也可用。" msgid "" "Uploaded files are no longer created as executable by default. If you need " "them to be executable change :setting:`FILE_UPLOAD_PERMISSIONS` to your " "needs. The new default value is ``0o666`` (octal) and the current umask " "value is first masked out." msgstr "" "上传的文件不再默认创建为可执行文件。如果需要它们成为可执行文件,请更改 :" "setting:`FILE_UPLOAD_PERMISSIONS` 以满足您的需求。新的默认值是 ``0o666`` (八" "进制),并且当前的掩码值首先被掩码掉。" msgid "" "The :class:`F expressions ` supported bitwise operators " "by ``&`` and ``|``. These operators are now available using ``.bitand()`` " "and ``.bitor()`` instead. The removal of ``&`` and ``|`` was done to be " "consistent with :ref:`Q() expressions ` and " "``QuerySet`` combining where the operators are used as boolean AND and OR " "operators." msgstr "" ":class:`F 表达式 ` 支持位运算符 ``&`` 和 ``|``。现在,可" "以使用 ``.bitand()`` 和 ``.bitor()`` 来代替这些运算符。移除 ``&`` 和 ``|`` 是" "为了与 :ref:`Q() 表达式 ` 和 ``QuerySet`` 结合使用时" "保持一致,其中这些运算符被用作布尔 AND 和 OR 运算符。" msgid "" "In a ``filter()`` call, when :class:`F expressions ` " "contained lookups spanning multi-valued relations, they didn't always reuse " "the same relations as other lookups along the same chain. This was changed, " "and now F() expressions will always use the same relations as other lookups " "within the same ``filter()`` call." msgstr "" "在 ``filter()`` 调用中,当 :class:`F 表达式 ` 包含跨多值" "关联的查找时,它们并不总是重用与同一链中其他查找相同的关联。这已经发生了变" "化,现在 F() 表达式将始终与同一 ``filter()`` 调用中的其他查找使用相同的关联。" msgid "" "The :ttag:`csrf_token` template tag is no longer enclosed in a div. If you " "need HTML validation against pre-HTML5 Strict DTDs, you should add a div " "around it in your pages." msgstr "" ":ttag:`csrf_token` 模板标签不再包含在一个 div 中。如果您需要针对 HTML5 之前" "的 Strict DTD 进行 HTML 验证,您应该在页面中添加一个 div。" msgid "" "The template tags library ``adminmedia``, which only contained the " "deprecated template tag ``{% admin_media_prefix %}``, was removed. " "Attempting to load it with ``{% load adminmedia %}`` will fail. If your " "templates still contain that line you must remove it." msgstr "" "已删除模板标签库 ``adminmedia``,它只包含了已弃用的模板标签 ``{% " "admin_media_prefix %}``。尝试使用 ``{% load adminmedia %}`` 加载它将会失败。" "如果您的模板仍然包含该行代码,您必须将其删除。" msgid "" "Because of an implementation oversight, it was possible to use :doc:`django." "contrib.redirects ` without enabling :doc:`django." "contrib.sites `. This isn't allowed any longer. If " "you're using ``django.contrib.redirects``, make sure :setting:" "`INSTALLED_APPS` contains ``django.contrib.sites``." msgstr "" "由于一个实现上的疏忽,以前可以在没有启用 :doc:`django.contrib.sites ` 的情况下使用 :doc:`django.contrib.redirects `。现在不再允许这样做了。如果您正在使用 ``django.contrib." "redirects``,请确保 :setting:`INSTALLED_APPS` 包含 ``django.contrib.sites``。" msgid "" ":meth:`BoundField.label_tag ` now escapes " "its ``contents`` argument. To avoid the HTML escaping, use :func:`django." "utils.safestring.mark_safe` on the argument before passing it." msgstr "" ":meth:`BoundField.label_tag ` 现在会对其 " "``contents`` 参数进行 HTML 转义。要避免 HTML 转义,可以在传递参数之前使用 :" "func:`django.utils.safestring.mark_safe`。" msgid "" "Accessing reverse one-to-one relations fetched via :meth:`~django.db.models." "query.QuerySet.select_related` now raises :exc:`~django.db.models.Model." "DoesNotExist` instead of returning ``None``." msgstr "" "通过 :meth:`~django.db.models.query.QuerySet.select_related` 获取的反向一对一" "关系现在会引发 :exc:`~django.db.models.Model.DoesNotExist` 异常,而不是返回 " "``None``。" msgid "Features deprecated in 1.5" msgstr "在 1.5 中被废弃的功能" msgid "``django.contrib.localflavor``" msgstr "``django.contrib.localflavor``" msgid "" "The localflavor contrib app has been split into separate packages. ``django." "contrib.localflavor`` itself will be removed in Django 1.6, after an " "accelerated deprecation." msgstr "" "localflavor 贡献应用程序已分成单独的包。``django.contrib.localflavor`` 本身将" "在 Django 1.6 中移除,经过加速的弃用期。" msgid "" "The new packages are available on GitHub. The core team cannot efficiently " "maintain these packages in the long term — it spans just a dozen countries " "at this time; similar to translations, maintenance will be handed over to " "interested members of the community." msgstr "" "新的软件包已在 GitHub 上提供。核心团队无法长期高效地维护这些软件包 - 目前仅覆" "盖了几个国家;与翻译类似,维护工作将移交给感兴趣的社区成员。" msgid "``django.contrib.markup``" msgstr "``django.contrib.markup``" msgid "" "The markup contrib module has been deprecated and will follow an accelerated " "deprecation schedule. Direct use of Python markup libraries or 3rd party tag " "libraries is preferred to Django maintaining this functionality in the " "framework." msgstr "" "markup contrib 模块已被弃用,并将按照加速弃用计划进行处理。直接使用 Python 标" "记库或第三方标签库比 Django 在框架中维护此功能更受推荐。" msgid "``AUTH_PROFILE_MODULE``" msgstr "``AUTH_PROFILE_MODULE``" msgid "" "With the introduction of :ref:`custom user models `, there " "is no longer any need for a built-in mechanism to store user profile data." msgstr "" "引入 :ref:`自定义用户模型 ` 后,不再需要内置机制来存储用户" "配置文件数据。" msgid "" "You can still define user profiles models that have a one-to-one relation " "with the User model - in fact, for many applications needing to associate " "data with a User account, this will be an appropriate design pattern to " "follow. However, the ``AUTH_PROFILE_MODULE`` setting, and the ``django." "contrib.auth.models.User.get_profile()`` method for accessing the user " "profile model, should not be used any longer." msgstr "" "您仍然可以定义与用户模型具有一对一关系的用户配置文件模型 - 实际上,对于许多需" "要将数据与用户帐户关联的应用程序,这将是一个适当的设计模式。然而,不再应使用 " "``AUTH_PROFILE_MODULE`` 设置以及用于访问用户配置文件模型的 ``django.contrib." "auth.models.User.get_profile()`` 方法。" msgid "Streaming behavior of :class:`~django.http.HttpResponse`" msgstr ":class:`~django.http.HttpResponse` 的流式传输行为" msgid "" "Django 1.5 deprecates the ability to stream a response by passing an " "iterator to :class:`~django.http.HttpResponse`. If you rely on this " "behavior, switch to :class:`~django.http.StreamingHttpResponse`. See :ref:" "`explicit-streaming-responses` above." msgstr "" "Django 1.5 不再支持通过将迭代器传递给 :class:`~django.http.HttpResponse` 来流" "式传输响应的能力。如果您依赖此行为,请切换到 :class:`~django.http." "StreamingHttpResponse`。请参阅 :ref:`explicit-streaming-responses`。" msgid "" "In Django 1.7 and above, the iterator will be consumed immediately by :class:" "`~django.http.HttpResponse`." msgstr "" "在 Django 1.7 及以上版本中,迭代器将立即被 :class:`~django.http." "HttpResponse` 消耗。" msgid "``django.utils.simplejson``" msgstr "``django.utils.simplejson``" msgid "" "Since Django 1.5 drops support for Python 2.5, we can now rely on the :mod:" "`json` module being available in Python's standard library, so we've removed " "our own copy of ``simplejson``. You should now import :mod:`json` instead of " "``django.utils.simplejson``." msgstr "" "由于 Django 1.5 不再支持 Python 2.5,我们现在可以依赖于 Python 标准库中的 :" "mod:`json` 模块,因此我们已经移除了我们自己的 ``simplejson`` 副本。您现在应该" "导入 :mod:`json`,而不是 ``django.utils.simplejson``。" msgid "" "Unfortunately, this change might have unwanted side-effects, because of " "incompatibilities between versions of ``simplejson`` -- see the :ref:" "`backwards-incompatible changes ` section. If " "you rely on features added to ``simplejson`` after it became Python's :mod:" "`json`, you should import ``simplejson`` explicitly." msgstr "" "不幸的是,这个改变可能会产生意想不到的副作用,因为不同版本的 ``simplejson`` " "之间存在不兼容性,详见 :ref:`不兼容变更 ` 部" "分。如果您依赖于在它成为 Python 的 :mod:`json` 之后添加到 ``simplejson`` 的功" "能,您应该显式导入 ``simplejson``。" msgid "``django.utils.encoding.StrAndUnicode``" msgstr "``django.utils.encoding.StrAndUnicode``" msgid "" "The ``django.utils.encoding.StrAndUnicode`` mix-in has been deprecated. " "Define a ``__str__`` method and apply the ``django.utils.encoding." "python_2_unicode_compatible`` decorator instead." msgstr "" "``django.utils.encoding.StrAndUnicode`` 混合类已被弃用。应该定义一个 " "``__str__`` 方法,并应用 ``django.utils.encoding." "python_2_unicode_compatible`` 装饰器。" msgid "``django.utils.itercompat.product``" msgstr "``django.utils.itercompat.product``" msgid "" "The ``django.utils.itercompat.product`` function has been deprecated. Use " "the built-in :func:`itertools.product` instead." msgstr "" "``django.utils.itercompat.product`` 函数已被弃用。应该使用内置的 :func:" "`itertools.product`。" msgid "``cleanup`` management command" msgstr "``cleanup`` 管理命令" msgid "" "The ``cleanup`` management command has been deprecated and replaced by :" "djadmin:`clearsessions`." msgstr "``cleanup`` 管理命令已被弃用,并被 :djadmin:`clearsessions` 取代。" msgid "``daily_cleanup.py`` script" msgstr "``daily_cleanup.py`` 脚本" msgid "" "The undocumented ``daily_cleanup.py`` script has been deprecated. Use the :" "djadmin:`clearsessions` management command instead." msgstr "" "未记录的 ``daily_cleanup.py`` 脚本已被弃用。请使用 :djadmin:`clearsessions` " "管理命令。" msgid "``depth`` keyword argument in ``select_related``" msgstr "``select_related`` 中的 ``depth`` 关键字参数" msgid "" "The ``depth`` keyword argument in :meth:`~django.db.models.query.QuerySet." "select_related` has been deprecated. You should use field names instead." msgstr "" "在 :meth:`~django.db.models.query.QuerySet.select_related` 中的 ``depth`` 关" "键字参数已被弃用。您应该使用字段名称代替。" msgid "Django 1.5.1 release notes" msgstr "Django 1.5.1 版本发行说明" msgid "*March 28, 2013*" msgstr "*2013 年 3 月 28 日*" msgid "" "This is Django 1.5.1, a bugfix release for Django 1.5. It's completely " "backwards compatible with Django 1.5, but includes a handful of fixes." msgstr "" "这是 Django 1.5.1,是 Django 1.5 的修复错误版本。它与 Django 1.5 完全向后兼" "容,但包含了一些修复。" msgid "" "The biggest fix is for a memory leak introduced in Django 1.5. Under certain " "circumstances, repeated iteration over querysets could leak memory - " "sometimes quite a bit of it. If you'd like more information, the details are " "in :ticket:`our ticket tracker <19895>` (and in :bpo:`a related issue " "<17468>` in Python itself)." msgstr "" "最重要的修复是针对 Django 1.5 引入的内存泄漏。在某些情况下,反复迭代查询集可" "能会导致内存泄漏 - 有时会泄漏相当多的内存。如果您想了解更多信息,详细信息可以" "在我们的 :ticket:`问题跟踪器 <19895>`(以及 Python 自身的 :bpo:`相关问题 " "<17468>`)中找到。" msgid "" "If you've noticed memory problems under Django 1.5, upgrading to 1.5.1 " "should fix those issues." msgstr "" "如果您在 Django 1.5 下遇到了内存问题,升级到 1.5.1 版本应该可以解决这些问题。" msgid "Django 1.5.1 also includes a couple smaller fixes:" msgstr "Django 1.5.1 还包含了一些较小的修复:" msgid "" "Module-level warnings emitted during tests are no longer silently hidden (:" "ticket:`18985`)." msgstr "在测试期间发出的模块级警告不再被默默隐藏 (:ticket:`18985`)。" msgid "" "Prevented filtering on password hashes in the user admin (:ticket:`20078`)." msgstr "防止在用户管理界面中对密码哈希进行过滤 (:ticket:`20078`)。" msgid "Django 1.5.10 release notes" msgstr "Django 1.5.10 版本发行说明" msgid "Django 1.5.10 fixes a regression in the 1.5.9 security release." msgstr "Django 1.5.10 修复了 1.5.9 安全发布中的回归错误。" msgid "Django 1.5.11 release notes" msgstr "Django 1.5.11 版本发行说明" msgid "Django 1.5.11 fixes a couple regressions in the 1.5.9 security release." msgstr "Django 1.5.11 修复了 1.5.9 安全发布中的一些回归错误。" msgid "Django 1.5.12 release notes" msgstr "Django 1.5.12 版本发行说明" msgid "Django 1.5.12 fixes a regression in the 1.5.9 security release." msgstr "Django 1.5.12 修复了 1.5.9 安全发布中的一个回归错误。" msgid "Django 1.5.2 release notes" msgstr "Django 1.5.2 版本发行说明" msgid "This is Django 1.5.2, a bugfix and security release for Django 1.5." msgstr "这是 Django 1.5.2,是 Django 1.5 的修复错误和安全发布版本。" msgid "XSS vulnerability in :mod:`django.contrib.admin`" msgstr ":mod:`django.contrib.admin` 中的 XSS 漏洞" msgid "" "If a :class:`~django.db.models.URLField` is used in Django 1.5, it displays " "the current value of the field and a link to the target on the admin change " "page. The display routine of this widget was flawed and allowed for XSS." msgstr "" "如果在 Django 1.5 中使用了 :class:`~django.db.models.URLField`,它会在管理页" "面的更改页面上显示字段的当前值和到目标的链接。这个小部件的显示程序存在缺陷," "允许进行 XSS 攻击。" msgid "" "Fixed a crash with :meth:`~django.db.models.query.QuerySet.prefetch_related` " "(#19607) as well as some ``pickle`` regressions with ``prefetch_related`` " "(#20157 and #20257)." msgstr "" "修复了与 :meth:`~django.db.models.query.QuerySet.prefetch_related` 有关的崩溃" "问题 (#19607),以及一些与 ``prefetch_related`` 有关的 ``pickle`` 回归问题 " "(#20157 和 #20257)。" msgid "" "Fixed a regression in :mod:`django.contrib.gis` in the Google Map output on " "Python 3 (#20773)." msgstr "" "在 Python 3 上修复了 :mod:`django.contrib.gis` 中 Google 地图输出的回归问题 " "(#20773)。" msgid "" "Made ``DjangoTestSuiteRunner.setup_databases`` properly handle aliases for " "the default database (#19940) and prevented ``teardown_databases`` from " "attempting to tear down aliases (#20681)." msgstr "" "使 ``DjangoTestSuiteRunner.setup_databases`` 正确处理默认数据库的别名 " "(#19940),并防止 ``teardown_databases`` 尝试拆除别名 (#20681)。" msgid "" "Fixed the ``django.core.cache.backends.memcached.MemcachedCache`` backend's " "``get_many()`` method on Python 3 (#20722)." msgstr "" "修复了 Python 3 上的 ``django.core.cache.backends.memcached.MemcachedCache`` " "后端的 ``get_many()`` 方法 (#20722)。" msgid "" "Fixed :mod:`django.contrib.humanize` translation syntax errors. Affected " "languages: Mexican Spanish, Mongolian, Romanian, Turkish (#20695)." msgstr "" "修复了 :mod:`django.contrib.humanize` 中的翻译语法错误。受影响的语言包括墨西" "哥西班牙语、蒙古语、罗马尼亚语和土耳其语 (#20695)。" msgid "Added support for wheel packages (#19252)." msgstr "新增对 wheel 软件包的支持( #19252 )。" msgid "The CSRF token now rotates when a user logs in." msgstr "用户登录时,CSRF 令牌现在会轮换。" msgid "Some Python 3 compatibility fixes including #20212 and #20025." msgstr "包括 #20212 和 #20025 在内的一些 Python 3 兼容性修复。" msgid "" "Fixed some rare cases where :meth:`~django.db.models.query.QuerySet.get` " "exceptions recursed infinitely (#20278)." msgstr "" "修复了一些罕见情况下 :meth:`~django.db.models.query.QuerySet.get` 引发无限递" "归异常的问题 (#20278)。" msgid "" ":djadmin:`makemessages` no longer crashes with ``UnicodeDecodeError`` " "(#20354)." msgstr "" ":djadmin:`makemessages` 不再因为 ``UnicodeDecodeError`` 而崩溃 (#20354)。" msgid "Fixed ``geojson`` detection with SpatiaLite." msgstr "修复了与 SpatiaLite 的 ``geojson`` 检测问题。" msgid "" ":meth:`~django.test.SimpleTestCase.assertContains` once again works with " "binary content (#20237)." msgstr "" ":meth:`~django.test.SimpleTestCase.assertContains` 再次能够处理二进制内容 " "(#20237)。" msgid "" "Fixed :class:`~django.db.models.ManyToManyField` if it has a Unicode " "``name`` parameter (#20207)." msgstr "" "修复了如果 :class:`~django.db.models.ManyToManyField` 具有 Unicode ``name`` " "参数时的问题 (#20207)。" msgid "" "Ensured that the WSGI request's path is correctly based on the " "``SCRIPT_NAME`` environment variable or the :setting:`FORCE_SCRIPT_NAME` " "setting, regardless of whether or not either has a trailing slash (#20169)." msgstr "" "确保 WSGI 请求的路径根据 ``SCRIPT_NAME`` 环境变量或 :setting:" "`FORCE_SCRIPT_NAME` 设置正确设置,无论它们是否以斜杠结尾 (#20169)。" msgid "Django 1.5.3 release notes" msgstr "Django 1.5.3 版本发行说明" msgid "" "This is Django 1.5.3, the third release in the Django 1.5 series. It " "addresses one security issue and also contains an opt-in feature to enhance " "the security of :mod:`django.contrib.sessions`." msgstr "" "这是 Django 1.5.3,是 Django 1.5 系列的第三个发布版本。它解决了一个安全问题," "并包含一个可选择的功能,以增强 :mod:`django.contrib.sessions` 的安全性。" msgid "" "Mitigating a remote-code execution vulnerability in :mod:`django.contrib." "sessions`" msgstr "应对 :mod:`django.contrib.sessions` 中的远程代码执行漏洞。" msgid "" ":mod:`django.contrib.sessions` currently uses :mod:`pickle` to serialize " "session data before storing it in the backend. If you're using the :ref:" "`signed cookie session backend` and :setting:" "`SECRET_KEY` is known by an attacker (there isn't an inherent vulnerability " "in Django that would cause it to leak), the attacker could insert a string " "into their session which, when unpickled, executes arbitrary code on the " "server. The technique for doing so is simple and easily available on the " "internet. Although the cookie session storage signs the cookie-stored data " "to prevent tampering, a :setting:`SECRET_KEY` leak immediately escalates to " "a remote code execution vulnerability." msgstr "" ":mod:`django.contrib.sessions` 目前在将会话数据存储到后端之前使用 :mod:" "`pickle` 进行序列化。如果您使用的是 :ref:`签名的 Cookie 会话后端 ` 并且 :setting:`SECRET_KEY` 被攻击者知晓(Django 本身没有固" "有的漏洞导致泄漏),攻击者可以在他们的会话中插入一个字符串,当反序列化时,在" "服务器上执行任意代码。执行此操作的技术简单且易于在互联网上找到。虽然 Cookie " "会话存储会对存储在 Cookie 中的数据进行签名以防止篡改,但一旦 :setting:" "`SECRET_KEY` 泄漏,立即升级为远程代码执行漏洞。" msgid "" "This attack can be mitigated by serializing session data using JSON rather " "than :mod:`pickle`. To facilitate this, Django 1.5.3 introduces a new " "setting, :setting:`SESSION_SERIALIZER`, to customize the session " "serialization format. For backwards compatibility, this setting defaults to " "using :mod:`pickle`. While JSON serialization does not support all Python " "objects like :mod:`pickle` does, we highly recommend switching to JSON-" "serialized values. Also, as JSON requires string keys, you will likely run " "into problems if you are using non-string keys in ``request.session``. See " "the :ref:`session_serialization` documentation for more details." msgstr "" "可以通过使用 JSON 而不是 :mod:`pickle` 对会话数据进行序列化来缓解此攻击。为了" "方便这一点,Django 1.5.3 引入了一个新的设置 :setting:`SESSION_SERIALIZER`,用" "于自定义会话序列化格式。为了向后兼容,默认情况下这个设置使用 :mod:`pickle`。" "虽然 JSON 序列化不像 :mod:`pickle` 那样支持所有的 Python 对象,但我们强烈建议" "切换到 JSON 序列化的值。此外,由于 JSON 要求使用字符串键,如果在 ``request." "session`` 中使用非字符串键,可能会遇到问题。有关更多详细信息,请参阅 :ref:" "`session_serialization` 文档。" msgid "Django 1.5.4 release notes" msgstr "Django 1.5.4 版本发行说明" msgid "" "This is Django 1.5.4, the fourth release in the Django 1.5 series. It " "addresses two security issues and one bug." msgstr "" "这是 Django 1.5.4,是 Django 1.5 系列的第四个版本。它解决了两个安全问题和一" "个 bug 。" msgid "" "As of 1.5.4, Django's authentication framework imposes a 4096-byte limit on " "passwords, and will fail authentication with any submitted password of " "greater length." msgstr "" "从 1.5.4 版本开始,Django 的身份验证框架对密码设置了 4096 字节的限制,如果提" "交的密码长度超过限制,身份验证将失败。" msgid "" "Fixed a bug that prevented a ``QuerySet`` that uses :meth:`~django.db.models." "query.QuerySet.prefetch_related` from being pickled and unpickled more than " "once (the second pickling attempt raised an exception) (#21102)." msgstr "" "修复了一个 bug,该 bug 阻止了使用 :meth:`~django.db.models.query.QuerySet." "prefetch_related` 的查询集被多次 pickled 和 unpickled(第二次 pickling 尝试会" "引发异常)(#21102)。" msgid "Django 1.5.5 release notes" msgstr "Django 1.5.5 版本发行说明" msgid "" "Django 1.5.5 fixes a couple security-related bugs and several other bugs in " "the 1.5 series." msgstr "Django 1.5.5 修复了一些与安全相关的错误以及 1.5 系列中的其他几个错误。" msgid "" "Django 1.5.4 imposes a 4096-byte limit on passwords in order to mitigate a " "denial-of-service attack through submission of bogus but extremely large " "passwords. In Django 1.5.5, we've reverted this change and instead improved " "the speed of our PBKDF2 algorithm by not rehashing the key on every " "iteration." msgstr "" "Django 1.5.4 为了减轻通过提交虚假但极其大的密码进行的拒绝服务攻击,对密码设置" "了 4096 字节的限制。在 Django 1.5.5 中,我们撤销了这一更改,改为通过不在每次" "迭代中重新计算哈希密钥来提高 PBKDF2 算法的速度。" msgid "Properly rotate CSRF token on login" msgstr "登录时正确地轮换 CSRF 令牌" msgid "" "This behavior introduced as a security hardening measure in Django 1.5.2 did " "not work properly and is now fixed." msgstr "" "这个在 Django 1.5.2 中作为安全加固措施引入的行为没有正常工作,现已修复。" msgid "" "Fixed a Python 3 incompatibility in ``django.utils.text." "unescape_entities()`` (#21185)." msgstr "" "修复了 ``django.utils.text.unescape_entities()`` 中的 Python 3 不兼容问题 " "(#21185)。" msgid "" "Fixed a couple data corruption issues with ``QuerySet`` edge cases under " "Oracle and MySQL (#21203, #21126)." msgstr "" "修复了在 Oracle 和 MySQL 下的一些 ``QuerySet`` 边缘情况下的数据损坏问题 " "(#21203, #21126)。" msgid "" "Fixed crashes when using combinations of ``annotate()``, " "``select_related()``, and ``only()`` (#16436)." msgstr "" "修复了在使用 ``annotate()``, ``select_related()`` 和 ``only()`` 的组合时引发" "崩溃的问题 (#16436)。" msgid "" "The undocumented ``django.core.servers.basehttp.WSGIServerException`` has " "been removed. Use ``socket.error`` provided by the standard library instead." msgstr "" "已删除未记录的 ``django.core.servers.basehttp.WSGIServerException``。请改用标" "准库提供的 ``socket.error``。" msgid "Django 1.5.6 release notes" msgstr "Django 1.5.6 版本发行说明" msgid "" "Django 1.5.6 fixes several bugs in 1.5.5, including three security issues." msgstr "Django 1.5.6 修复了 1.5.5 中的多个错误,包括三个安全问题。" msgid "" "Fixed :class:`~django.contrib.auth.backends.ModelBackend` raising " "``UnboundLocalError`` if :func:`~django.contrib.auth.get_user_model` raised " "an error (#21439)." msgstr "" "修复了如果 :func:`~django.contrib.auth.get_user_model` 引发错误时, :class:" "`~django.contrib.auth.backends.ModelBackend` 引发 ``UnboundLocalError`` 的问" "题 (#21439)。" msgid "" "Additionally, Django's vendored version of six, ``django.utils.six``, has " "been upgraded to the latest release (1.6.1)." msgstr "" "此外,Django 内置的 six 版本 ``django.utils.six`` 已升级到最新版本 (1.6.1)。" msgid "Django 1.5.7 release notes" msgstr "Django 1.5.7 版本发行说明" msgid "Django 1.5.7 fixes a regression in the 1.5.6 security release." msgstr "Django 1.5.7 修复了 1.5.6 安全发布中的一个退化问题。" msgid "Django 1.5.8 release notes" msgstr "Django 1.5.8 版本发行说明" msgid "Django 1.5.8 fixes two security issues in 1.5.8." msgstr "Django 1.5.8 修复了 1.5.8 中的两个安全问题。" msgid "Django 1.5.9 release notes" msgstr "Django 1.5.9 版本发行说明" msgid "Django 1.5.9 fixes several security issues in 1.5.8." msgstr "Django 1.5.9 修复了 1.5.8 中的多个安全问题。" msgid "Django 1.6 release notes" msgstr "Django 1.6 版本发行说明" msgid "Dedicated to Malcolm Tredinnick" msgstr "献给 Malcolm Tredinnick" msgid "" "On March 17, 2013, the Django project and the free software community lost a " "very dear friend and developer." msgstr "" "在 2013 年 3 月 17 日,Django 项目和自由软件社区失去了一位非常亲爱的朋友和开" "发者。" msgid "" "Malcolm was a long-time contributor to Django, a model community member, a " "brilliant mind, and a friend. His contributions to Django — and to many " "other open source projects — are nearly impossible to enumerate. Many on the " "core Django team had their first patches reviewed by him; his mentorship " "enriched us. His consideration, patience, and dedication will always be an " "inspiration to us." msgstr "" "Malcolm 是 Django 的长期贡献者,模范社区成员,一位聪明的人,也是我们的朋友。" "他对 Django 和其他许多开源项目的贡献几乎无法计数。 Django 核心团队中的许多人" "都是通过他审查第一批补丁,他的指导使我们受益匪浅。他的关心、耐心和奉献精神将" "永远激励着我们。" msgid "This release of Django is for Malcolm." msgstr "这个 Django 版本是为了纪念 Malcolm 而发布的。" msgid "-- The Django Developers" msgstr "-- Django 开发者们" msgid "Welcome to Django 1.6!" msgstr "欢迎使用 Django 1.6 !" msgid "" "These release notes cover the :ref:`new features `, as well " "as some :ref:`backwards incompatible changes ` " "you'll want to be aware of when upgrading from Django 1.5 or older versions. " "We've also dropped some features, which are detailed in :ref:`our " "deprecation plan `, and we've :ref:`begun the " "deprecation process for some features `." msgstr "" "这些发布说明涵盖了 :ref:`新功能 `,以及从 Django 1.5 或更早版" "本升级时需要注意的一些 :ref:`向后不兼容的更改 `。" "我们还删除了一些功能,详细信息在 :ref:`我们的弃用计划 ` 中说明,同时我们已经 :ref:`开始了一些功能的弃用过程 `。" msgid "" "Django 1.6, like Django 1.5, requires Python 2.6.5 or above. Python 3 is " "also officially supported. We **highly recommend** the latest minor release " "for each supported Python series (2.6.X, 2.7.X, 3.2.X, and 3.3.X)." msgstr "" "与 Django 1.5 一样,Django 1.6 需要 Python 2.6.5 或更高版本。Python 3 也得到" "官方支持。我们 **强烈推荐** 使用每个支持的 Python 系列的最新次要版本(2.6.X、" "2.7.X、3.2.X 和 3.3.X)。" msgid "" "Django 1.6 will be the final release series to support Python 2.6; beginning " "with Django 1.7, the minimum supported Python version will be 2.7." msgstr "" "Django 1.6 将是最后一个支持 Python 2.6 的发布系列;从 Django 1.7 开始,最低支" "持的 Python 版本将是 2.7 。" msgid "Python 3.4 is not supported, but support will be added in Django 1.7." msgstr "Python 3.4 目前不被支持,但将在 Django 1.7 中添加支持。" msgid "What's new in Django 1.6" msgstr "Django 1.6 的新功能有哪些?" msgid "Simplified default project and app templates" msgstr "简化了默认的项目和应用模板" msgid "" "The default templates used by :djadmin:`startproject` and :djadmin:" "`startapp` have been simplified and modernized. The :doc:`admin ` is now enabled by default in new projects; the :doc:" "`sites ` framework no longer is. :ref:`clickjacking " "prevention ` is now on and the database defaults to " "SQLite." msgstr "" ":djadmin:`startproject` 和 :djadmin:`startapp` 使用的默认模板已经简化和现代" "化。新项目默认启用 :doc:`admin `,不再使用 :doc:" "`sites ` 框架。:ref:`防止点击劫持 ` 现在默认开启,数据库默认为 SQLite。" msgid "" "If the default templates don't suit your tastes, you can use :ref:`custom " "project and app templates `." msgstr "" "如果默认模板不符合您的喜好,您可以使用 :ref:`自定义项目和应用程序模板 " "`。" msgid "Improved transaction management" msgstr "改进了事务管理" msgid "" "Django's transaction management was overhauled. Database-level autocommit is " "now turned on by default. This makes transaction handling more explicit and " "should improve performance. The existing APIs were deprecated, and new APIs " "were introduced, as described in the :doc:`transaction management docs `." msgstr "" "Django 的事务管理经过了彻底改进。现在默认情况下已经打开了数据库级别的自动提" "交。这使得事务处理更加明确,并应该提高性能。现有的 API 已被弃用,并引入了新" "的 API,详情请参阅 :doc:`事务管理文档 `。" msgid "Persistent database connections" msgstr "引入了持久性数据库连接" msgid "" "Django now supports reusing the same database connection for several " "requests. This avoids the overhead of reestablishing a connection at the " "beginning of each request. For backwards compatibility, this feature is " "disabled by default. See :ref:`persistent-database-connections` for details." msgstr "" "Django 现在支持在多个请求中重复使用同一个数据库连接。这可以避免在每个请求开始" "时重新建立连接的开销。出于向后兼容性考虑,此功能默认是禁用的。请查看 :ref:" "`persistent-database-connections` 以获取详细信息。" msgid "Discovery of tests in any test module" msgstr "能够发现任何测试模块中的测试" msgid "" "Django 1.6 ships with a new test runner that allows more flexibility in the " "location of tests. The previous runner (``django.test.simple." "DjangoTestSuiteRunner``) found tests only in the ``models.py`` and ``tests." "py`` modules of a Python package in :setting:`INSTALLED_APPS`." msgstr "" "Django 1.6 提供了一个新的测试运行器,允许更灵活地定位测试。之前的运行器" "(``django.test.simple.DjangoTestSuiteRunner``)只在 :setting:" "`INSTALLED_APPS` 中的 Python 包的 ``models.py`` 和 ``tests.py`` 模块中找到测" "试。" msgid "" "The new runner (``django.test.runner.DiscoverRunner``) uses the test " "discovery features built into ``unittest2`` (the version of ``unittest`` in " "the Python 2.7+ standard library, and bundled with Django). With test " "discovery, tests can be located in any module whose name matches the pattern " "``test*.py``." msgstr "" "新的运行器(``django.test.runner.DiscoverRunner``)使用了内置于 " "``unittest2`` 中的测试发现功能(Python 2.7+ 标准库中的 ``unittest`` 版本,与 " "Django 捆绑在一起)。使用测试发现,测试可以位于任何模块中,其名称匹配模式 " "``test*.py``。" msgid "" "In addition, the test labels provided to ``./manage.py test`` to nominate " "specific tests to run must now be full Python dotted paths (or directory " "paths), rather than ``applabel.TestCase.test_method_name`` pseudo-paths. " "This allows running tests located anywhere in your codebase, rather than " "only in :setting:`INSTALLED_APPS`. For more details, see :doc:`/topics/" "testing/index`." msgstr "" "此外,提供给 ``./manage.py test`` 的测试标签,用于指定要运行的特定测试,现在" "必须是完整的 Python 点路径(或目录路径),而不是伪路径 ``applabel.TestCase." "test_method_name``。这允许运行位于代码库中任何位置的测试,而不仅仅是 :" "setting:`INSTALLED_APPS` 中的测试。有关更多详细信息,请参阅 :doc:`/topics/" "testing/index`。" msgid "" "This change is backwards-incompatible; see the :ref:`backwards-" "incompatibility notes`." msgstr "" "这个改变是向后不兼容的,请参阅 :ref:`向后不兼容的说明`。" msgid "Time zone aware aggregation" msgstr "时区感知的聚合" msgid "" "The support for :doc:`time zones ` introduced in " "Django 1.4 didn't work well with :meth:`QuerySet.dates() `: aggregation was always performed in UTC. This " "limitation was lifted in Django 1.6. Use :meth:`QuerySet.datetimes() ` to perform time zone aware aggregation " "on a :class:`~django.db.models.DateTimeField`." msgstr "" "Django 1.4 中引入的对 :doc:`时区 ` 的支持在 :meth:" "`QuerySet.dates() ` 上并不完善:聚合总" "是在 UTC 中执行。在 Django 1.6 中解除了这个限制。使用 :meth:`QuerySet." "datetimes() ` 来对 :class:" "`~django.db.models.DateTimeField` 进行时区感知的聚合。" msgid "Support for savepoints in SQLite" msgstr "在 SQLite 中支持保存点(savepoints)" msgid "" "Django 1.6 adds support for savepoints in SQLite, with some :ref:" "`limitations `." msgstr "" "Django 1.6 在 SQLite 中添加了对保存点的支持,但存在一些 :ref:`限制 " "`。" msgid "``BinaryField`` model field" msgstr "``BinaryField`` 模型字段" msgid "" "A new :class:`django.db.models.BinaryField` model field allows storage of " "raw binary data in the database." msgstr "" "新的 :class:`django.db.models.BinaryField` 模型字段允许在数据库中存储原始二进" "制数据。" msgid "GeoDjango form widgets" msgstr "GeoDjango 表单小部件" msgid "" "GeoDjango now provides :doc:`form fields and widgets ` for its geo-specialized fields. They are OpenLayers-based by default, " "but they can be customized to use any other JS framework." msgstr "" "GeoDjango 现在为其地理专用字段提供了 :doc:`表单字段和小部件 `。它们默认使用 OpenLayers,但可以自定义为使用任何其他 " "JavaScript 框架。" msgid "``check`` management command added for verifying compatibility" msgstr "新增了 ``check`` 管理命令,用于验证兼容性。" msgid "" "A :djadmin:`check` management command was added, enabling you to verify if " "your current configuration (currently oriented at settings) is compatible " "with the current version of Django." msgstr "" "新增了 :djadmin:`check` 管理命令,可以用来验证您当前的配置(目前是基于设置)" "是否与当前版本的 Django 兼容。" msgid ":meth:`Model.save() ` algorithm changed" msgstr ":meth:`Model.save() ` 算法已更改" msgid "" "The :meth:`Model.save() ` method now tries to " "directly ``UPDATE`` the database if the instance has a primary key value. " "Previously ``SELECT`` was performed to determine if ``UPDATE`` or ``INSERT`` " "were needed. The new algorithm needs only one query for updating an existing " "row while the old algorithm needed two. See :meth:`Model.save() ` for more details." msgstr "" ":meth:`Model.save() ` 方法现在会尝试直接执行数" "据库 ``UPDATE`` 操作,如果实例具有主键值。以前会执行 ``SELECT`` 来确定是否需" "要执行 ``UPDATE`` 或 ``INSERT``。新算法只需要一次查询来更新现有行,而旧算法需" "要两次。有关更多详细信息,请参阅 :meth:`Model.save() `。" msgid "" "In some rare cases the database doesn't report that a matching row was found " "when doing an ``UPDATE``. An example is the PostgreSQL ``ON UPDATE`` trigger " "which returns ``NULL``. In such cases it is possible to set :attr:`django.db." "models.Options.select_on_save` flag to force saving to use the old algorithm." msgstr "" "在一些罕见的情况下,数据库在执行 ``UPDATE`` 时可能不会报告找到匹配的行。一个" "例子是 PostgreSQL 中的 ``ON UPDATE`` 触发器,它返回 ``NULL``。在这种情况下," "可以设置 :attr:`django.db.models.Options.select_on_save` 标志来强制使用旧算法" "进行保存。" msgid "" "Authentication backends can raise ``PermissionDenied`` to immediately fail " "the authentication chain." msgstr "身份验证后端可以引发 ``PermissionDenied`` 来立即终止身份验证链。" msgid "" "The ``HttpOnly`` flag can be set on the CSRF cookie with :setting:" "`CSRF_COOKIE_HTTPONLY`." msgstr "" "可以使用 :setting:`CSRF_COOKIE_HTTPONLY` 来在 CSRF Cookie 上设置 " "``HttpOnly`` 标志。" msgid "" "The ``assertQuerysetEqual()`` now checks for undefined order and raises :exc:" "`ValueError` if undefined order is spotted. The order is seen as undefined " "if the given ``QuerySet`` isn't ordered and there is more than one ordered " "value to compare against." msgstr "" "``assertQuerysetEqual()`` 现在检查未定义的排序,并在发现未定义的排序时引发 :" "exc:`ValueError`。如果给定的 ``QuerySet`` 没有排序,并且有多个排序值要进行比" "较,那么排序被视为未定义。" msgid "" "Added :meth:`~django.db.models.query.QuerySet.earliest` for symmetry with :" "meth:`~django.db.models.query.QuerySet.latest`." msgstr "" "新增了 :meth:`~django.db.models.query.QuerySet.earliest`,以与 :meth:" "`~django.db.models.query.QuerySet.latest` 对称。" msgid "" "In addition to :lookup:`year`, :lookup:`month` and :lookup:`day`, the ORM " "now supports :lookup:`hour`, :lookup:`minute` and :lookup:`second` lookups." msgstr "" "除了 :lookup:`year`、:lookup:`month` 和 :lookup:`day`,ORM 现在还支持 :" "lookup:`hour`、:lookup:`minute` 和 :lookup:`second` 查找。" msgid "Django now wraps all :pep:`249` exceptions." msgstr "Django 现在包装了所有 :pep:`249` 异常。" msgid "" "The default widgets for :class:`~django.forms.EmailField`, :class:`~django." "forms.URLField`, :class:`~django.forms.IntegerField`, :class:`~django.forms." "FloatField` and :class:`~django.forms.DecimalField` use the new type " "attributes available in HTML5 (``type='email'``, ``type='url'``, " "``type='number'``). Note that due to erratic support of the ``number`` input " "type with localized numbers in current browsers, Django only uses it when " "numeric fields are not localized." msgstr "" ":class:`~django.forms.EmailField`、:class:`~django.forms.URLField`、:class:" "`~django.forms.IntegerField`、:class:`~django.forms.FloatField` 和 :class:" "`~django.forms.DecimalField` 的默认小部件现在使用 HTML5 中可用的新类型属性" "(``type='email'``、``type='url'``、``type='number'``)。请注意,由于当前浏览" "器中对本地化数字支持不稳定,因此 Django 只在数值字段未本地化时使用 " "``number`` 输入类型。" msgid "" "The ``number`` argument for :ref:`lazy plural translations ` can be provided at translation time rather than at definition " "time." msgstr "" "对于 :ref:`延迟复数翻译 `,可以在翻译时提供 " "``number`` 参数,而不是在定义时提供。" msgid "" "For custom management commands: Verification of the presence of valid " "settings in commands that ask for it by using the ``BaseCommand." "can_import_settings`` internal option is now performed independently from " "handling of the locale that should be active during the execution of the " "command. The latter can now be influenced by the new ``BaseCommand." "leave_locale_alone`` internal option. See :ref:`management-commands-and-" "locales` for more details." msgstr "" "对于自定义管理命令:在要求使用 ``BaseCommand.can_import_settings`` 内部选项的" "命令中,现在独立于处理执行命令期间应处于活动状态的区域设置的验证。后者现在可" "以受到新的 ``BaseCommand.leave_locale_alone`` 内部选项的影响。有关更多详细信" "息,请参阅 :ref:`管理命令和区域设置`。" msgid "" "The :attr:`~django.views.generic.edit.DeletionMixin.success_url` of :class:" "`~django.views.generic.edit.DeletionMixin` is now interpolated with its " "``object``’s ``__dict__``." msgstr "" ":class:`~django.views.generic.edit.DeletionMixin` 的 :attr:`~django.views." "generic.edit.DeletionMixin.success_url` 现在使用其 ``object`` 的 " "``__dict__`` 进行插值。" msgid "" ":class:`~django.http.HttpResponseRedirect` and :class:`~django.http." "HttpResponsePermanentRedirect` now provide an ``url`` attribute (equivalent " "to the URL the response will redirect to)." msgstr "" ":class:`~django.http.HttpResponseRedirect` 和 :class:`~django.http." "HttpResponsePermanentRedirect` 现在提供了一个 ``url`` 属性(等同于响应将重定" "向到的 URL)。" msgid "" "The ``MemcachedCache`` cache backend now uses the latest :mod:`pickle` " "protocol available." msgstr "``MemcachedCache`` 缓存后端现在使用了最新可用的 :mod:`pickle` 协议。" msgid "" "Added :class:`~django.contrib.messages.views.SuccessMessageMixin` which " "provides a ``success_message`` attribute for :class:`~django.views.generic." "edit.FormView` based classes." msgstr "" "新增了 :class:`~django.contrib.messages.views.SuccessMessageMixin`,它为基" "于 :class:`~django.views.generic.edit.FormView` 的类提供了一个 " "``success_message`` 属性。" msgid "" "Added the :attr:`django.db.models.ForeignKey.db_constraint` and :attr:" "`django.db.models.ManyToManyField.db_constraint` options." msgstr "" "新增了 :attr:`django.db.models.ForeignKey.db_constraint` 和 :attr:`django.db." "models.ManyToManyField.db_constraint` 选项。" msgid "" "The jQuery library embedded in the admin has been upgraded to version 1.9.1." msgstr "jQuery 库嵌入在管理系统中已升级至 1.9.1 版本。" msgid "" "Syndication feeds (:mod:`django.contrib.syndication`) can now pass extra " "context through to feed templates using a new :meth:`Feed.get_context_data() " "` callback." msgstr "" "现在,通过新的 :meth:`Feed.get_context_data() ` 回调,订阅源(:mod:`django.contrib.syndication`)可以" "将额外的上下文传递给订阅源模板。" msgid "" "The admin list columns have a ``column-`` class in the HTML so " "the columns header can be styled with CSS, e.g. to set a column width." msgstr "" "在 HTML 中,管理员列表列具有 ``column-`` 类,因此可以使用 CSS 对" "列标题进行样式设置,例如设置列宽。" msgid "" "The :ref:`isolation level` can be customized under " "PostgreSQL." msgstr "" "在 PostgreSQL 下,可以自定义 :ref:`隔离级别 `。" msgid "" "The :ttag:`blocktrans` template tag now respects " "``TEMPLATE_STRING_IF_INVALID`` for variables not present in the context, " "just like other template constructs." msgstr "" ":ttag:`blocktrans` 模板标签现在像其他模板结构一样,尊重对于上下文中不存在的变" "量的 ``TEMPLATE_STRING_IF_INVALID``。" msgid "" "``SimpleLazyObject``\\s will now present more helpful representations in " "shell debugging situations." msgstr "在 shell 调试情况下,``SimpleLazyObject`` 现在会提供更有帮助的表示。" msgid "" "Generic :class:`~django.contrib.gis.db.models.GeometryField` is now editable " "with the OpenLayers widget in the admin." msgstr "" "通用的 :class:`~django.contrib.gis.db.models.GeometryField` 现在可以在管理员" "中使用 OpenLayers 小部件进行编辑。" msgid "" "The documentation contains a :doc:`deployment checklist `." msgstr "文档中包含一个 :doc:`部署清单 `。" msgid "The :djadmin:`diffsettings` command gained a ``--all`` option." msgstr ":djadmin:`diffsettings` 命令增加了 ``--all`` 选项。" msgid "" "``django.forms.fields.Field.__init__`` now calls ``super()``, allowing field " "mixins to implement ``__init__()`` methods that will reliably be called." msgstr "" "``django.forms.fields.Field.__init__`` 现在调用了 ``super()``,允许字段混合类" "实现 ``__init__()`` 方法,并可靠地被调用。" msgid "" "The ``validate_max`` parameter was added to ``BaseFormSet`` and :func:" "`~django.forms.formsets.formset_factory`, and ``ModelForm`` and inline " "versions of the same. The behavior of validation for formsets with " "``max_num`` was clarified. The previously undocumented behavior that " "hardened formsets against memory exhaustion attacks was documented, and the " "undocumented limit of the higher of 1000 or ``max_num`` forms was changed so " "it is always 1000 more than ``max_num``." msgstr "" "在 ``BaseFormSet`` 和 :func:`~django.forms.formsets.formset_factory` 以及 " "``ModelForm`` 和相应的内联版本中添加了 ``validate_max`` 参数。对于带有 " "``max_num`` 的表单集的验证行为进行了澄清。之前未记录的行为,以防止内存耗尽攻" "击的表单集被记录下来,同时未记录的高于 1000 或 ``max_num`` 的上限已更改,现在" "它总是比 ``max_num`` 多 1000。" msgid "" "Added ``BCryptSHA256PasswordHasher`` to resolve the password truncation " "issue with bcrypt." msgstr "添加了 ``BCryptSHA256PasswordHasher`` 来解决 bcrypt 密码截断问题。" msgid "" ":pypi:`Pillow` is now the preferred image manipulation library to use with " "Django. :pypi:`PIL` is pending deprecation (support to be removed in Django " "1.8). To upgrade, you should **first** uninstall PIL, **then** install " "Pillow." msgstr "" ":pypi:`Pillow` 现在是与 Django 一起使用的首选图像处理库。 :pypi:`PIL` 已经进" "入弃用过程(在 Django 1.8 中将删除支持)。要升级,您应该 **首先** 卸载 PIL," "**然后** 安装 Pillow。" msgid ":class:`~django.forms.ModelForm` accepts several new ``Meta`` options." msgstr ":class:`~django.forms.ModelForm` 接受了一些新的 ``Meta`` 选项。" msgid "" "Fields included in the ``localized_fields`` list will be localized (by " "setting ``localize`` on the form field)." msgstr "" "包含在 ``localized_fields`` 列表中的字段将会本地化(通过在表单字段上设置 " "``localize``)。" msgid "" "The ``labels``, ``help_texts`` and ``error_messages`` options may be used " "to customize the default fields, see :ref:`modelforms-overriding-default-" "fields` for details." msgstr "" "``labels``、``help_texts`` 和 ``error_messages`` 选项可以用来自定义默认字段," "请参阅 :ref:`modelforms-overriding-default-fields` 获取详细信息。" msgid "" "The ``choices`` argument to model fields now accepts an iterable of " "iterables instead of requiring an iterable of lists or tuples." msgstr "" "模型字段的 ``choices`` 参数现在接受一个可迭代的可迭代对象,而不是需要一个列表" "或元组的可迭代对象。" msgid "" "The reason phrase can be customized in HTTP responses using :attr:`~django." "http.HttpResponse.reason_phrase`." msgstr "" "可以使用 :attr:`~django.http.HttpResponse.reason_phrase` 来自定义 HTTP 响应的" "原因短语。" msgid "" "When giving the URL of the next page for ``django.contrib.auth.views." "logout()``, ``django.contrib.auth.views.password_reset()``, ``django.contrib." "auth.views.password_reset_confirm()``, and ``django.contrib.auth.views." "password_change()``, you can now pass URL names and they will be resolved." msgstr "" "在为 ``django.contrib.auth.views.logout()``、``django.contrib.auth.views." "password_reset()``、``django.contrib.auth.views.password_reset_confirm()`` " "和 ``django.contrib.auth.views.password_change()`` 提供下一页的 URL 时,现在" "可以传递 URL 名称,并将其解析。" msgid "" "The new :option:`dumpdata --pks` option specifies the primary keys of " "objects to dump. This option can only be used with one model." msgstr "" "新的 :option:`dumpdata --pks` 选项指定要转储的对象的主键。此选项只能与一个模" "型一起使用。" msgid "" "Added ``QuerySet`` methods :meth:`~django.db.models.query.QuerySet.first` " "and :meth:`~django.db.models.query.QuerySet.last` which are convenience " "methods returning the first or last object matching the filters. Returns " "``None`` if there are no objects matching." msgstr "" "新增了 ``QuerySet`` 方法 :meth:`~django.db.models.query.QuerySet.first` 和 :" "meth:`~django.db.models.query.QuerySet.last`,这些是返回与过滤条件匹配的第一" "个或最后一个对象的便利方法。如果没有匹配的对象,则返回 ``None``。" msgid "" ":class:`~django.views.generic.base.View` and :class:`~django.views.generic." "base.RedirectView` now support HTTP ``PATCH`` method." msgstr "" ":class:`~django.views.generic.base.View` 和 :class:`~django.views.generic." "base.RedirectView` 现在支持 HTTP ``PATCH`` 方法。" msgid "" "``GenericForeignKey`` now takes an optional ``for_concrete_model`` argument, " "which when set to ``False`` allows the field to reference proxy models. The " "default is ``True`` to retain the old behavior." msgstr "" "``GenericForeignKey`` 现在接受一个可选的 ``for_concrete_model`` 参数,当设置" "为 ``False`` 时,允许字段引用代理模型。默认值为 ``True``,以保留旧的行为。" msgid "" "The :class:`~django.middleware.locale.LocaleMiddleware` now stores the " "active language in session if it is not present there. This prevents loss of " "language settings after session flush, e.g. logout." msgstr "" ":class:`~django.middleware.locale.LocaleMiddleware` 现在如果活动语言不在会话" "中,则会将其存储在会话中。这可以防止在会话刷新后(例如注销)丢失语言设置。" msgid "" ":exc:`~django.core.exceptions.SuspiciousOperation` has been differentiated " "into a number of subclasses, and each will log to a matching named logger " "under the ``django.security`` logging hierarchy. Along with this change, a " "``handler400`` mechanism and default view are used whenever a " "``SuspiciousOperation`` reaches the WSGI handler to return an " "``HttpResponseBadRequest``." msgstr "" ":exc:`~django.core.exceptions.SuspiciousOperation` 被细分为多个子类,并且每个" "子类都会记录到与 ``django.security`` 日志层次结构下的匹配命名的记录器中。随着" "这个变化,每当一个 ``SuspiciousOperation`` 到达 WSGI 处理程序以返回一个 " "``HttpResponseBadRequest`` 时,将使用 ``handler400`` 机制和默认视图。" msgid "" "The :exc:`~django.db.models.Model.DoesNotExist` exception now includes a " "message indicating the name of the attribute used for the lookup." msgstr "" ":exc:`~django.db.models.Model.DoesNotExist` 异常现在包含一个消息,指示用于查" "找的属性的名称。" msgid "" "The :meth:`~django.db.models.query.QuerySet.get_or_create` method no longer " "requires at least one keyword argument." msgstr "" ":meth:`~django.db.models.query.QuerySet.get_or_create` 方法不再需要至少一个关" "键字参数。" msgid "" "The :class:`~django.test.SimpleTestCase` class includes a new assertion " "helper for testing formset errors: ``django.test.SimpleTestCase." "assertFormsetError()``." msgstr "" ":class:`~django.test.SimpleTestCase` 类包括一个用于测试表单集错误的新断言助" "手:``django.test.SimpleTestCase.assertFormsetError()``。" msgid "" "The list of related fields added to a :class:`~django.db.models.query." "QuerySet` by :meth:`~django.db.models.query.QuerySet.select_related` can be " "cleared using ``select_related(None)``." msgstr "" "通过 :meth:`~django.db.models.query.QuerySet.select_related` 添加到 :class:" "`~django.db.models.query.QuerySet` 的相关字段列表可以使用 " "``select_related(None)`` 清除。" msgid "" "The :meth:`~django.contrib.admin.InlineModelAdmin.get_extra` and :meth:" "`~django.contrib.admin.InlineModelAdmin.get_max_num` methods on :class:" "`~django.contrib.admin.InlineModelAdmin` may be overridden to customize the " "extra and maximum number of inline forms." msgstr "" ":class:`~django.contrib.admin.InlineModelAdmin` 上的 :meth:`~django.contrib." "admin.InlineModelAdmin.get_extra` 和 :meth:`~django.contrib.admin." "InlineModelAdmin.get_max_num` 方法可以被覆盖,以自定义内联表单的额外和最大数" "量。" msgid "" "Formsets now have a :meth:`~django.forms.formsets.BaseFormSet." "total_error_count` method." msgstr "" "现在,表单集具有一个 :meth:`~django.forms.formsets.BaseFormSet." "total_error_count` 方法。" msgid "" ":class:`~django.forms.ModelForm` fields can now override error messages " "defined in model fields by using the :attr:`~django.forms.Field." "error_messages` argument of a ``Field``’s constructor. To take advantage of " "this new feature with your custom fields, :ref:`see the updated " "recommendation ` for raising a ``ValidationError``." msgstr "" ":class:`~django.forms.ModelForm` 字段现在可以使用 ``Field`` 构造函数的 :attr:" "`~django.forms.Field.error_messages` 参数覆盖模型字段中定义的错误消息。要利用" "这个新特性来自定义字段,请参阅 :ref:`更新的建议 ` " "来引发 ``ValidationError``。" msgid "" ":class:`~django.contrib.admin.ModelAdmin` now preserves filters on the list " "view after creating, editing or deleting an object. It's possible to restore " "the previous behavior of clearing filters by setting the :attr:`~django." "contrib.admin.ModelAdmin.preserve_filters` attribute to ``False``." msgstr "" ":class:`~django.contrib.admin.ModelAdmin` 在创建、编辑或删除对象后,现在会保" "留列表视图上的过滤器。可以通过将 :attr:`~django.contrib.admin.ModelAdmin." "preserve_filters` 属性设置为 ``False`` 来恢复以前的清除过滤器的行为。" msgid "" "Added :meth:`FormMixin.get_prefix` (which returns :attr:`FormMixin.prefix` by default) to allow customizing the :attr:`~django." "forms.Form.prefix` of the form." msgstr "" "新增了 :meth:`FormMixin.get_prefix` (默认返回 :attr:`FormMixin.prefix`),允许自定义表单的 :attr:`~django.forms.Form.prefix`。" msgid "" "Raw queries (``Manager.raw()`` or ``cursor.execute()``) can now use the " "\"pyformat\" parameter style, where placeholders in the query are given as " "``'%(name)s'`` and the parameters are passed as a dictionary rather than a " "list (except on SQLite). This has long been possible (but not officially " "supported) on MySQL and PostgreSQL, and is now also available on Oracle." msgstr "" "原始查询(``Manager.raw()`` 或 ``cursor.execute()``)现在可以使用 " "\"pyformat\" 参数样式,其中查询中的占位符以 ``'%(name)s'`` 形式给出,参数以字" "典形式传递,而不是列表(在 SQLite 上除外)。在 MySQL 和 PostgreSQL 上早就支持" "(但未得到官方支持),现在在 Oracle 上也可用。" msgid "" "The default iteration count for the PBKDF2 password hasher has been " "increased by 20%. This backwards compatible change will not affect existing " "passwords or users who have subclassed ``django.contrib.auth.hashers." "PBKDF2PasswordHasher`` to change the default value. Passwords :ref:`will be " "upgraded ` to use the new iteration count as necessary." msgstr "" "PBKDF2 密码哈希器的默认迭代次数增加了 20%。这个向后兼容的更改不会影响现有的密" "码或已经子类化 ``django.contrib.auth.hashers.PBKDF2PasswordHasher`` 以更改默" "认值的用户。必要时,密码将 :ref:`被升级 ` 以使用新的迭代次" "数。" msgid "Backwards incompatible changes in 1.6" msgstr "Django 1.6 中的向后不兼容变更" msgid "" "In addition to the changes outlined in this section, be sure to review the :" "ref:`deprecation plan ` for any features that " "have been removed. If you haven't updated your code within the deprecation " "timeline for a given feature, its removal may appear as a backwards " "incompatible change." msgstr "" "除了本节中概述的更改之外,还请务必查看 :ref:`弃用计划 `,以了解已删除的功能。如果在给定功能的弃用时间范围内未更新代码,则其" "删除可能会显示为不向后兼容的更改。" msgid "New transaction management model" msgstr "全新的事务管理模型" msgid "Behavior changes" msgstr "行为变更" msgid "" "Database-level autocommit is enabled by default in Django 1.6. While this " "doesn't change the general spirit of Django's transaction management, there " "are a few backwards-incompatibilities." msgstr "" "在 Django 1.6 中,默认情况下启用了数据库级别的自动提交。虽然这不会改变 " "Django 事务管理的一般原则,但会引入一些不兼容性。" msgid "Savepoints and ``assertNumQueries``" msgstr "保存点和 ``assertNumQueries``" msgid "" "The changes in transaction management may result in additional statements to " "create, release or rollback savepoints. This is more likely to happen with " "SQLite, since it didn't support savepoints until this release." msgstr "" "事务管理的变更可能会导致额外的语句来创建、释放或回滚保存点。这在 SQLite 中更" "有可能发生,因为在此版本之前它不支持保存点。" msgid "" "If tests using :meth:`~django.test.TransactionTestCase.assertNumQueries` " "fail because of a higher number of queries than expected, check that the " "extra queries are related to savepoints, and adjust the expected number of " "queries accordingly." msgstr "" "如果使用 :meth:`~django.test.TransactionTestCase.assertNumQueries` 的测试因查" "询次数超过预期而失败,请检查额外的查询是否与保存点相关,并相应地调整预期的查" "询次数。" msgid "Autocommit option for PostgreSQL" msgstr "PostgreSQL 的自动提交选项" msgid "" "In previous versions, database-level autocommit was only an option for " "PostgreSQL, and it was disabled by default. This option is now ignored and " "can be removed." msgstr "" "在先前版本中,数据库级别的自动提交仅适用于 PostgreSQL,并且默认情况下被禁用。" "现在该选项被忽略并可以移除。" msgid "New test runner" msgstr "全新的测试运行器" msgid "" "In order to maintain greater consistency with Python's ``unittest`` module, " "the new test runner (``django.test.runner.DiscoverRunner``) does not " "automatically support some types of tests that were supported by the " "previous runner:" msgstr "" "为了与 Python 的 ``unittest`` 模块保持更一致,新的测试运行器(``django.test." "runner.DiscoverRunner``)不会自动支持以前的运行器支持的一些测试类型:" msgid "" "Tests in ``models.py`` and ``tests/__init__.py`` files will no longer be " "found and run. Move them to a file whose name begins with ``test``." msgstr "" "不再会查找和运行 ``models.py`` 和 ``tests/__init__.py`` 文件中的测试。将它们" "移到文件名以 ``test`` 开头的文件中。" msgid "" "Doctests will no longer be automatically discovered. To integrate doctests " "in your test suite, follow the :ref:`recommendations in the Python " "documentation `." msgstr "" "不再自动发现 doctests。要将 doctests 集成到测试套件中,请遵循 Python 文档中" "的 :ref:`建议 `。" msgid "" "Django bundles a modified version of the :mod:`doctest` module from the " "Python standard library (in ``django.test._doctest``) and includes some " "additional doctest utilities. These utilities are deprecated and will be " "removed in Django 1.8; doctest suites should be updated to work with the " "standard library's doctest module (or converted to ``unittest``-compatible " "tests)." msgstr "" "Django 包含了 Python 标准库中的 :mod:`doctest` 模块的修改版本(在 ``django." "test._doctest`` 中),并包含一些额外的 doctest 工具。这些工具已被弃用,并将" "在 Django 1.8 中删除;doctest 测试套件应该更新以使用标准库的 doctest 模块(或" "转换为与 ``unittest`` 兼容的测试)。" msgid "" "If you wish to delay updates to your test suite, you can set your :setting:" "`TEST_RUNNER` setting to ``django.test.simple.DjangoTestSuiteRunner`` to " "fully restore the old test behavior. ``DjangoTestSuiteRunner`` is deprecated " "but will not be removed from Django until version 1.8." msgstr "" "如果希望延迟更新测试套件,可以将 :setting:`TEST_RUNNER` 设置为 ``django.test." "simple.DjangoTestSuiteRunner``,以完全恢复旧的测试行为。虽然 " "``DjangoTestSuiteRunner`` 已被弃用,但在 Django 1.8 版本之前不会从 Django 中" "删除。" msgid "" "Removal of ``django.contrib.gis.tests.GeoDjangoTestSuiteRunner`` GeoDjango " "custom test runner" msgstr "" "移除了 ``django.contrib.gis.tests.GeoDjangoTestSuiteRunner`` GeoDjango 自定义" "测试运行器。" msgid "" "This is for developers working on the GeoDjango application itself and " "related to the item above about changes in the test runners:" msgstr "" "这适用于开发 GeoDjango 应用程序本身及其相关开发人员,与上述有关测试运行器变更" "的项目相关:" msgid "" "The ``django.contrib.gis.tests.GeoDjangoTestSuiteRunner`` test runner has " "been removed and the standalone GeoDjango tests execution setup it " "implemented isn't supported anymore. To run the GeoDjango tests simply use " "the new ``DiscoverRunner`` and specify the ``django.contrib.gis`` app." msgstr "" "``django.contrib.gis.tests.GeoDjangoTestSuiteRunner`` 测试运行器已被移除,它" "实现的独立 GeoDjango 测试执行设置不再受支持。要运行 GeoDjango 测试,只需使用" "新的 ``DiscoverRunner`` 并指定 ``django.contrib.gis`` 应用程序。" msgid "Custom user models in tests" msgstr "在测试中使用自定义用户模型" msgid "" "The introduction of the new test runner has also slightly changed the way " "that test models are imported. As a result, any test that overrides " "``AUTH_USER_MODEL`` to test behavior with one of Django's test user models " "( ``django.contrib.auth.tests.custom_user.CustomUser`` and ``django.contrib." "auth.tests.custom_user.ExtensionUser``) must now explicitly import the User " "model in your test module::" msgstr "" "新测试运行器的引入也稍微改变了测试模型的导入方式。因此,任何覆盖 " "``AUTH_USER_MODEL`` 以测试与 Django 的测试用户模型之一(``django.contrib." "auth.tests.custom_user.CustomUser`` 和 ``django.contrib.auth.tests." "custom_user.ExtensionUser``)行为的测试现在必须在测试模块中显式导入用户模型:" msgid "" "This import forces the custom user model to be registered. Without this " "import, the test will be unable to swap in the custom user model, and you " "will get an error reporting:" msgstr "" "这个导入语句会强制注册自定义用户模型。如果没有这个导入语句,测试将无法切换到" "自定义用户模型,你将会收到一个错误报告:" msgid "Time zone-aware ``day``, ``month``, and ``week_day`` lookups" msgstr "时间区域感知的 ``day``、``month`` 和 ``week_day`` 查找" msgid "" "Django 1.6 introduces time zone support for :lookup:`day`, :lookup:`month`, " "and :lookup:`week_day` lookups when :setting:`USE_TZ` is ``True``. These " "lookups were previously performed in UTC regardless of the current time zone." msgstr "" "Django 1.6 在 :setting:`USE_TZ` 为 ``True`` 时引入了对 :lookup:`day`、:" "lookup:`month` 和 :lookup:`week_day` 查找的时间区域支持。以前,这些查找在不考" "虑当前时区的情况下都在 UTC 中执行。" msgid "" "This requires :ref:`time zone definitions in the database `. If you're using SQLite, you must install pytz_. If " "you're using MySQL, you must install pytz_ and load the time zone tables " "with `mysql_tzinfo_to_sql`_." msgstr "" "这需要数据库中的 :ref:`时区定义 `。如果使用的" "是 SQLite,你必须安装 pytz_。如果使用的是 MySQL,你必须安装 pytz_ 并使用 " "`mysql_tzinfo_to_sql`_ 加载时区表。" msgid "Addition of ``QuerySet.datetimes()``" msgstr "添加了 ``QuerySet.datetimes()`` 方法" msgid "" "When the :doc:`time zone support ` added in Django " "1.4 was active, :meth:`QuerySet.dates() ` lookups returned unexpected results, because the aggregation was " "performed in UTC. To fix this, Django 1.6 introduces a new API, :meth:" "`QuerySet.datetimes() `. This " "requires a few changes in your code." msgstr "" "当 Django 1.4 中添加的 :doc:`时区支持 ` 处于活动状态" "时,:meth:`QuerySet.dates() ` 查找返回" "了意外的结果,因为聚合是在 UTC 中执行的。为了解决这个问题,Django 1.6 引入了" "一个新的 API,:meth:`QuerySet.datetimes() `。这需要在你的代码中进行一些更改。" msgid "``QuerySet.dates()`` returns ``date`` objects" msgstr "``QuerySet.dates()`` 返回的是 ``date`` 对象" msgid "" ":meth:`QuerySet.dates() ` now returns " "a list of :class:`~datetime.date`. It used to return a list of :class:" "`~datetime.datetime`." msgstr "" ":meth:`QuerySet.dates() ` 现在返回的" "是 :class:`~datetime.date` 的列表。它以前返回的是 :class:`~datetime." "datetime` 的列表。" msgid "" ":meth:`QuerySet.datetimes() ` " "returns a list of :class:`~datetime.datetime`." msgstr "" ":meth:`QuerySet.datetimes() ` 返回" "的是 :class:`~datetime.datetime` 的列表。" msgid "``QuerySet.dates()`` no longer usable on ``DateTimeField``" msgstr "``QuerySet.dates()`` 不再适用于 ``DateTimeField``" msgid "" ":meth:`QuerySet.dates() ` raises an " "error if it's used on :class:`~django.db.models.DateTimeField` when time " "zone support is active. Use :meth:`QuerySet.datetimes() ` instead." msgstr "" "当时间区域支持处于活动状态时,如果在 :class:`~django.db.models." "DateTimeField` 上使用 :meth:`QuerySet.dates() ` 会引发错误。此时应该使用 :meth:`QuerySet.datetimes() " "`。" msgid "``date_hierarchy`` requires time zone definitions" msgstr "``date_hierarchy`` 需要时间区域定义" msgid "" "The :attr:`~django.contrib.admin.ModelAdmin.date_hierarchy` feature of the " "admin now relies on :meth:`QuerySet.datetimes() ` when it's used on a :class:`~django.db.models." "DateTimeField`." msgstr "" "在管理员中使用 :attr:`~django.contrib.admin.ModelAdmin.date_hierarchy` 特性" "时,如果它用于 :class:`~django.db.models.DateTimeField`,现在会依赖于 :meth:" "`QuerySet.datetimes() `。" msgid "" "This requires time zone definitions in the database when :setting:`USE_TZ` " "is ``True``. :ref:`Learn more `." msgstr "" "这需要在数据库中启用时区定义,当 :setting:`USE_TZ` 设置为 ``True`` 时。详细信" "息请参阅 :ref:`了解更多 `。" msgid "``date_list`` in generic views requires time zone definitions" msgstr "在通用视图中使用的 ``date_list`` 需要时间区域的定义" msgid "" "For the same reason, accessing ``date_list`` in the context of a date-based " "generic view requires time zone definitions in the database when the view is " "based on a :class:`~django.db.models.DateTimeField` and :setting:`USE_TZ` is " "``True``. :ref:`Learn more `." msgstr "" "出于相同的原因,当视图基于 :class:`~django.db.models.DateTimeField` 且 :" "setting:`USE_TZ` 设置为 ``True`` 时,在日期为基础的通用视图中访问上下文中的 " "``date_list`` 需要数据库中的时间区域定义。详细信息请参阅 :ref:`了解更多 " "`。" msgid "New lookups may clash with model fields" msgstr "新的查找可能与模型字段冲突" msgid "" "Django 1.6 introduces ``hour``, ``minute``, and ``second`` lookups on :class:" "`~django.db.models.DateTimeField`. If you had model fields called ``hour``, " "``minute``, or ``second``, the new lookups will clash with you field names. " "Append an explicit :lookup:`exact` lookup if this is an issue." msgstr "" "Django 1.6 引入了在 :class:`~django.db.models.DateTimeField` 上的 ``hour``、" "``minute`` 和 ``second`` 查找。如果您的模型字段名为 ``hour``、``minute`` 或 " "``second``,新的查找可能会与您的字段名冲突。如果出现此问题,请附加一个明确" "的 :lookup:`exact` 查找。" msgid "``BooleanField`` no longer defaults to ``False``" msgstr "``BooleanField`` 不再默认为 ``False``" msgid "" "When a :class:`~django.db.models.BooleanField` doesn't have an explicit :" "attr:`~django.db.models.Field.default`, the implicit default value is " "``None``. In previous version of Django, it was ``False``, but that didn't " "represent accurately the lack of a value." msgstr "" "当一个 :class:`~django.db.models.BooleanField` 没有明确的 :attr:`~django.db." "models.Field.default` 时,隐式的默认值是 ``None``。在之前的 Django 版本中,默" "认值是 ``False``,但这并没有准确地表示缺少值。" msgid "" "Code that relies on the default value being ``False`` may raise an exception " "when saving new model instances to the database, because ``None`` isn't an " "acceptable value for a :class:`~django.db.models.BooleanField`. You should " "either specify ``default=False`` in the field definition, or ensure the " "field is set to ``True`` or ``False`` before saving the object." msgstr "" "依赖默认值为 ``False`` 的代码在保存新的模型实例到数据库时可能会引发异常,因" "为 ``None`` 不是 :class:`~django.db.models.BooleanField` 的可接受值。您应该在" "字段定义中明确指定 ``default=False``,或者在保存对象之前确保字段被设置为 " "``True`` 或 ``False``。" msgid "Translations and comments in templates" msgstr "模板中的翻译和注释" msgid "Extraction of translations after comments" msgstr "提取注释后的翻译内容" msgid "" "Extraction of translatable literals from templates with the :djadmin:" "`makemessages` command now correctly detects i18n constructs when they are " "located after a ``{#`` / ``#}``-type comment on the same line. E.g.:" msgstr "" "使用 :djadmin:`makemessages` 命令从模板中提取可翻译文字时,现在可以正确检测到" "位于同一行的 ``{#`` / ``#}`` 类型的注释之后的 i18n 构造。例如:" msgid "Location of translator comments" msgstr "翻译者注释的位置" msgid "" ":ref:`translator-comments-in-templates` specified using ``{#`` / ``#}`` need " "to be at the end of a line. If they are not, the comments are ignored and :" "djadmin:`makemessages` will generate a warning. For example:" msgstr "" ":ref:`translator-comments-in-templates` 使用 ``{#`` / ``#}`` 指定的注释必须位" "于一行的末尾。如果不是,这些注释将被忽略,并且 :djadmin:`makemessages` 将生成" "警告。例如:" msgid "Quoting in ``reverse()``" msgstr "``reverse()`` 中的引号" msgid "" "When reversing URLs, Django didn't apply ``django.utils.http.urlquote`` to " "arguments before interpolating them in URL patterns. This bug is fixed in " "Django 1.6. If you worked around this bug by applying URL quoting before " "passing arguments to ``reverse()``, this may result in double-quoting. If " "this happens, simply remove the URL quoting from your code. You will also " "have to replace special characters in URLs used in :func:`~django.test." "SimpleTestCase.assertRedirects` with their encoded versions." msgstr "" "在反查 URL 时,Django 在将参数插入 URL 模式之前未应用 ``django.utils.http." "urlquote``。这个 bug 在 Django 1.6 中已经修复。如果你之前通过在将参数传递给 " "``reverse()`` 之前应用 URL 引用来解决这个问题,这可能导致双重引用。如果发生这" "种情况,请从你的代码中移除 URL 引用。你还需要将在 :func:`~django.test." "SimpleTestCase.assertRedirects` 中使用的 URL 中的特殊字符替换为它们的编码版" "本。" msgid "Storage of IP addresses in the comments app" msgstr "在评论应用中存储 IP 地址" msgid "" "The comments app now uses a ``GenericIPAddressField`` for storing " "commenters' IP addresses, to support comments submitted from IPv6 addresses. " "Until now, it stored them in an ``IPAddressField``, which is only meant to " "support IPv4. When saving a comment made from an IPv6 address, the address " "would be silently truncated on MySQL databases, and raise an exception on " "Oracle. You will need to change the column type in your database to benefit " "from this change." msgstr "" "评论应用现在使用 ``GenericIPAddressField`` 来存储评论者的IP地址,以支持从 " "IPv6 地址提交的评论。直到现在,它们是存储在 ``IPAddressField`` 中的,这个字段" "只支持 IPv4。当保存来自 IPv6 地址的评论时,在 MySQL 数据库上,该地址将被静默" "截断,并在 Oracle 上引发异常。你需要更改数据库中的列类型才能从这个更改中受" "益。" msgid "For MySQL, execute this query on your project's database:" msgstr "对于 MySQL,在您的项目数据库上执行以下查询:" msgid "For Oracle, execute this query:" msgstr "对于 Oracle,请执行以下查询:" msgid "" "If you do not apply this change, the behavior is unchanged: on MySQL, IPv6 " "addresses are silently truncated; on Oracle, an exception is generated. No " "database change is needed for SQLite or PostgreSQL databases." msgstr "" "如果您不应用此更改,行为将保持不变:在 MySQL 上,IPv6 地址会被静默截断;在 " "Oracle 上,会生成异常。对于 SQLite 或 PostgreSQL 数据库,不需要进行数据库更" "改。" msgid "Percent literals in ``cursor.execute`` queries" msgstr "在 ``cursor.execute`` 查询中的百分比文字面值" msgid "" "When you are running raw SQL queries through the :ref:`cursor.execute " "` method, the rule about doubling percent literals " "(``%``) inside the query has been unified. Past behavior depended on the " "database backend. Now, across all backends, you only need to double literal " "percent characters if you are also providing replacement parameters. For " "example::" msgstr "" "当你通过 :ref:`cursor.execute ` 方法运行原始 SQL 查询" "时,关于在查询内部加倍百分比文字面值(``%``)的规则已经统一。过去的行为取决于" "数据库后端。现在,在所有后端中,只有在你还提供替换参数的情况下,才需要加倍文" "字百分比字符。例如:" msgid "``SQLite`` users need to check and update such queries." msgstr "``SQLite`` 用户需要检查和更新这样的查询。" msgid "Help text of model form fields for ManyToManyField fields" msgstr "对于 ManyToManyField 字段的模型表单字段的帮助文本。" msgid "" "HTML rendering of model form fields corresponding to :class:`~django.db." "models.ManyToManyField` model fields used to get the hard-coded sentence:" msgstr "" "HTML 渲染模型表单字段,对应于用于获取硬编码句子的 :class:`~django.db.models." "ManyToManyField` 模型字段:" msgid "" "*Hold down \"Control\", or \"Command\" on a Mac, to select more than one.*" msgstr "" "*按住 \"Control\" 键,或者在 Mac 上按住 \"Command\" 键,以选择多个选项。*" msgid "" "(or its translation to the active locale) imposed as the help legend shown " "along them if neither :attr:`model ` nor :" "attr:`form ` ``help_text`` attributes were " "specified by the user (or this string was appended to any ``help_text`` that " "was provided)." msgstr "" "(或其翻译成活动语言环境的版本)将作为帮助提示显示在它们旁边,如果用户没有指" "定 :attr:`model ` 或 :attr:`form ` ``help_text`` 属性(或者该字符串被附加到任何已提供的 " "``help_text`` 中)。" msgid "" "Since this happened at the model layer, there was no way to prevent the text " "from appearing in cases where it wasn't applicable such as form fields that " "implement user interactions that don't involve a keyboard and/or a mouse." msgstr "" "由于这发生在模型层,因此无法阻止文本在不适用的情况下出现,例如实现了不涉及键" "盘和/或鼠标的用户交互的表单字段。" msgid "" "Starting with Django 1.6, as an ad-hoc temporary backward-compatibility " "provision, the logic to add the \"Hold down...\" sentence has been moved to " "the model form field layer and modified to add the text only when the " "associated widget is :class:`~django.forms.SelectMultiple` or selected " "subclasses." msgstr "" "从 Django 1.6 开始,作为临时的向后兼容性规定,添加 \"按住...\" 句子的逻辑已经" "移动到模型表单字段层,并修改为仅在关联的小部件为 :class:`~django.forms." "SelectMultiple` 或其选定的子类时添加文本。" msgid "" "The change can affect you in a backward incompatible way if you employ " "custom model form fields and/or widgets for ``ManyToManyField`` model fields " "whose UIs do rely on the automatic provision of the mentioned hard-coded " "sentence. These form field implementations need to adapt to the new scenario " "by providing their own handling of the ``help_text`` attribute." msgstr "" "如果您为依赖于提供的硬编码句子的自动方式的 ``ManyToManyField`` 模型字段使用自" "定义模型表单字段和/或小部件,这个变更可以以向后不兼容的方式影响您。这些表单字" "段实现需要适应新的情况,通过提供自己的处理 ``help_text`` 属性的方式来处理它。" msgid "" "Applications that use Django :doc:`model form ` " "facilities together with Django built-in form :doc:`fields ` and :doc:`widgets ` aren't affected but need to " "be aware of what's described in :ref:`m2m-help_text-deprecation` below." msgstr "" "使用 Django :doc:`模型表单 ` 功能以及 Django 内置的" "表单 :doc:`字段 ` 和 :doc:`小部件 ` 的" "应用不受影响,但需要注意下面 :ref:`m2m-help_text-deprecation` 中描述的内容。" msgid "QuerySet iteration" msgstr "QuerySet 迭代" msgid "" "The ``QuerySet`` iteration was changed to immediately convert all fetched " "rows to ``Model`` objects. In Django 1.5 and earlier the fetched rows were " "converted to ``Model`` objects in chunks of 100." msgstr "" "``QuerySet`` 的迭代方式已更改为立即将所有检索到的行转换为 ``Model`` 对象。在 " "Django 1.5 及之前,检索到的行是以 100 行为单位转换为 ``Model`` 对象的。" msgid "" "Existing code will work, but the amount of rows converted to objects might " "change in certain use cases. Such usages include partially looping over a " "queryset or any usage which ends up doing ``__bool__`` or ``__contains__``." msgstr "" "现有的代码将正常工作,但在某些用例中,转换为对象的行数可能会发生变化。这些用" "法包括部分遍历查询集或任何最终执行 ``__bool__`` 或 ``__contains__`` 操作的用" "法。" msgid "" "Notably most database backends did fetch all the rows in one go already in " "1.5." msgstr "值得注意的是,大多数数据库后端在 1.5 版本中已经一次性获取了所有行。" msgid "" "It is still possible to convert the fetched rows to ``Model`` objects lazily " "by using the :meth:`~django.db.models.query.QuerySet.iterator()` method." msgstr "" "仍然可以通过使用 :meth:`~django.db.models.query.QuerySet.iterator()` 方法来惰" "性地将检索到的行转换为 ``Model`` 对象。" msgid "" ":meth:`BoundField.label_tag` now includes " "the form's :attr:`~django.forms.Form.label_suffix`" msgstr "" ":meth:`BoundField.label_tag` 现在包括表单" "的 :attr:`~django.forms.Form.label_suffix`" msgid "" "This is consistent with how methods like :meth:`Form.as_p` and :meth:`Form.as_ul` render labels." msgstr "" "这与 :meth:`Form.as_p` 和 :meth:`Form.as_ul` 等方法呈现标签的方式保持一致。" msgid "If you manually render ``label_tag`` in your templates:" msgstr "如果您在模板中手动呈现 ``label_tag``:" msgid "" "you'll want to remove the colon (or whatever other separator you may be " "using) to avoid duplicating it when upgrading to Django 1.6. The following " "template in Django 1.6 will render identically to the above template in " "Django 1.5, except that the colon will appear inside the ``