# Advanced Functionality
# http://flask-admin.readthedocs.io/en/latest/advanced/
#
# Copyright (C) 2012-2015, Serge S. Koval
# This file is distributed under the same license as the flask-admin
# package.
# 1dot75cm <sensor.wen@gmail.com>, 2016.
#
msgid ""
msgstr ""
"Project-Id-Version: flask-admin 1.4.2\n"
"Report-Msgid-Bugs-To: https://github.com/sixu05202004/Flask-extensions-docs\n"
"POT-Creation-Date: 2016-11-25 03:00+0800\n"
"PO-Revision-Date: 2016-11-27 03:00+0800\n"
"Last-Translator: 1dot75cm <sensor.wen@gmail.com>\n"
"Language-Team: zh_CN <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.3.4\n"

#: ../../advanced.rst:4
msgid "Advanced Functionality"
msgstr "高级功能"

#: ../../advanced.rst:7
msgid "Enabling CSRF Protection"
msgstr "启用 CSRF 保护"

#: ../../advanced.rst:9
msgid ""
"To add CSRF protection to the forms that are generated by *ModelView* "
"instances, use the SecureForm class in your *ModelView* subclass by "
"specifying the *form_base_class* parameter::"
msgstr ""
"要向 *ModelView* 实例生成的表单添加 CSRF 保护，请在 *ModelView* 子类中将 "
"*form_base_class* 参数值设为 SecureForm 类::"

#: ../../advanced.rst:18
msgid ""
"SecureForm requires WTForms 2 or greater. It uses the WTForms SessionCSRF"
" class to generate and validate the tokens for you when the forms are "
"submitted."
msgstr ""
"SecureForm 需要 WTForms 2+。当表单提交时，它使用 WTForms SessionCSRF "
"类来生成和验证令牌。"

#: ../../advanced.rst:22
msgid "Localization With Flask-Babelex"
msgstr "使用 Flask-Babelex 本地化"

#: ../../advanced.rst:26
msgid ""
"Flask-Admin comes with translations for several languages. Enabling "
"localization is simple:"
msgstr ""
"Flask-Admin 提供多种语言的翻译。启用本地化非常简单:"

#: ../../advanced.rst:29
msgid ""
"Install `Flask-BabelEx <http://github.com/mrjoes/flask-babelex/>`_ to do "
"the heavy lifting. It's a fork of the `Flask-Babel "
"<http://github.com/mitshuhiko/flask-babel/>`_ package::"
msgstr ""
"安装 `Flask-BabelEx <http://github.com/mrjoes/flask-babelex/>`_ 扩展，"
"它是 `Flask-Babel <http://github.com/mitshuhiko/flask-babel/>`_ 的分支::"

#: ../../advanced.rst:35
msgid "Initialize Flask-BabelEx by creating instance of `Babel` class::"
msgstr "通过创建 `Babel` 类实例，初始化 Flask-BabelEx 扩展::"

#: ../../advanced.rst:43
msgid "Create a locale selector function::"
msgstr "创建区域选择器函数::"

#: ../../advanced.rst:51
msgid ""
"Now, you could try a French version of the application at: "
"`http://localhost:5000/admin/?lang=fr "
"<http://localhost:5000/admin/?lang=fr>`_."
msgstr ""
"现在，您能够访问法语版本的管理界面: "
"`http://localhost:5000/admin/?lang=fr "
"<http://localhost:5000/admin/?lang=fr>`_。"

#: ../../advanced.rst:53
msgid ""
"Go ahead and add your own logic to the locale selector function. The "
"application can store locale in a user profile, cookie, session, etc. It "
"can also use the `Accept-Language` header to make the selection "
"automatically."
msgstr ""
"继续，添加您的区域设置到语言选择器函数。应用程序可以将区域设置存储在"
"用户 profile, cookie, session 中。它还可以使用 `Accept-Language` 头"
"来自动选择语言。"

#: ../../advanced.rst:57
msgid ""
"If the built-in translations are not enough, look at the `Flask-BabelEx "
"documentation <https://pythonhosted.org/Flask-BabelEx/>`_ to see how you "
"can add your own."
msgstr ""
"如果内置的翻译不够，请查看 `Flask-BabelEx 文档 "
"<https://pythonhosted.org/Flask-BabelEx/>`_ 了解如何添加翻译。"

#: ../../advanced.rst:63
msgid "Managing Files & Folders"
msgstr "管理文件 & 目录"

#: ../../advanced.rst:67
msgid ""
"To manage static files instead of database records, Flask-Admin comes "
"with the FileAdmin plug-in. It gives you the ability to upload, delete, "
"rename, etc. You can use it by adding a FileAdmin view to your app::"
msgstr ""
"为了管理静态文件而不是数据库记录，Flask-Admin 附带了 FileAdmin 插件。"
"它使您能够上传，删除，重命名文件。您可以通过向应用程序添加 FileAdmin 视图来使用该功能::"

#: ../../advanced.rst:83
msgid ""
"FileAdmin also has out-of-the-box support for managing files located on a"
" Amazon Simple Storage Service bucket. To add it to your app::"
msgstr ""
"FileAdmin 还具有管理 Amazon Simple Storage 服务的文件的开箱支持。"
"将该功能添加到应用程序::"

#: ../../advanced.rst:93
msgid ""
"You can disable uploads, disable file deletion, restrict file uploads to "
"certain types, etc. Check :mod:`flask_admin.contrib.fileadmin` in the API"
" documentation for more details."
msgstr ""
"您可以配置禁用上传，禁用文件删除，限制上传文件的类型等功能。详细信息，请参阅 "
":mod:`flask_admin.contrib.fileadmin` API 文档。"

#: ../../advanced.rst:97
msgid "Adding new file backends"
msgstr "添加新文件后端"

#: ../../advanced.rst:99
msgid ""
"You can also implement your own storage backend by creating a class that "
"implements the same methods defined in the `LocalFileStorage` class. "
"Check :mod:`flask_admin.contrib.fileadmin` in the API documentation for "
"details on the methods."
msgstr ""
"您还可以通过继承 `LocalFileStorage` 类并重写其中的方法来实现自己的存储后端。"
"有关方法的详细信息，请参阅 :mod:`flask_admin.contrib.fileadmin` API 文档。"

#: ../../advanced.rst:104
msgid "Adding A Redis Console"
msgstr "添加 Redis 控制台"

#: ../../advanced.rst:108
msgid ""
"Another plug-in that's available is the Redis Console. If you have a "
"Redis instance running on the same machine as your app, you can::"
msgstr ""
"另一个可用的插件是 Redis 控制台。如果您的 Redis 实例与应用程序"
"在同一个节点上运行，您可以::"

#: ../../advanced.rst:122
msgid "Replacing Individual Form Fields"
msgstr "替换单个表单域"

#: ../../advanced.rst:126
msgid ""
"The `form_overrides` attribute allows you to replace individual fields "
"within a form. A common use-case for this would be to add a *What-You-"
"See-Is-What-You-Get* (WYSIWIG) editor, or to handle file / image uploads "
"that need to be tied to a field in your model."
msgstr ""
"`form_overrides` 属性允许您替换表单中的单个字段。一个常见的用例是添加一个 "
"What-You-See-Is-What-You-Get (WYSIWIG, 所见即所得) 编辑器，"
"或处理需要绑定到模型中的文件/图像上传字段。"

#: ../../advanced.rst:131
msgid "WYSIWIG Text Fields"
msgstr "WYSIWIG 文本字段"

#: ../../advanced.rst:132
msgid ""
"To handle complicated text content, you can use `CKEditor "
"<http://ckeditor.com/>`_ by subclassing some of the built-in WTForms "
"classes as follows::"
msgstr ""
"要处理复杂的文本内容，可以通过子类化一些内置的 WTForms 类来集成 "
"`CKEditor <http://ckeditor.com/>`_ 编辑器，示例如下::"

#: ../../advanced.rst:157
msgid ""
"For this to work, you would also need to create a template that extends "
"the default functionality by including the necessary CKEditor javascript "
"on the `create` and `edit` pages. Save this in "
"`templates/ckeditor.html`::"
msgstr ""
"为了使其工作，还需要创建一个模板，通过在 `create` 和 `edit` 页面包含必要的 "
"CKEditor javascript 来扩展默认功能。将其保存在 `templates/ckeditor.html` 中::"

#: ../../advanced.rst:169
msgid "File & Image Fields"
msgstr "文件 & 图片字段"

#: ../../advanced.rst:171
msgid ""
"Flask-Admin comes with a built-in "
":meth:`~flask_admin.form.upload.FileUploadField` and "
":meth:`~flask_admin.form.upload.ImageUploadField`. To make use of them, "
"you'll need to specify an upload directory and add them to the forms in "
"question. Image handling also requires you to have `Pillow "
"<https://pypi.python.org/pypi/Pillow/2.8.2>`_ installed if you need to do"
" any processing on the image files."
msgstr ""
"Flask-Admin 内置有 "
":meth:`~flask_admin.form.upload.FileUploadField` 和 "
":meth:`~flask_admin.form.upload.ImageUploadField`。"
"要使用它们，您需要指定一个上传目录，并将它们添加到表单中。"
"如果您需要对图像文件进行处理，则需要安装 `Pillow "
"<https://pypi.python.org/pypi/Pillow/>`_。"

#: ../../advanced.rst:177
msgid ""
"Have a look at the example at https://github.com/flask-admin/Flask-"
"Admin/tree/master/examples/forms."
msgstr ""
"请查看 https://github.com/flask-admin/Flask-Admin/"
"tree/master/examples/forms 示例。"

#: ../../advanced.rst:180
msgid ""
"If you are using the MongoEngine backend, Flask-Admin supports GridFS-"
"backed image and file uploads through WTForms fields. Documentation can "
"be found at :mod:`flask_admin.contrib.mongoengine.fields`."
msgstr ""
"如果您使用 MongoEngine 后端，Flask-Admin 支持通过 WTForms 字段上传的文件/图片，"
"保存在 GridFS 后端中。详细信息，请参阅 :mod:`flask_admin.contrib.mongoengine."
"fields` 文档。"

#: ../../advanced.rst:182
msgid ""
"If you just want to manage static files in a directory, without tying "
"them to a database model, then use the :ref:`File-Admin<file-admin>` "
"plug-in."
msgstr ""
"如果您只想管理目录中的静态文件，而不是将其绑定到数据库模型，"
"则使用 :ref:`File-Admin<file-admin>` 插件。"

#: ../../advanced.rst:186
msgid "Managing Geographical Models"
msgstr "管理地理模型"

#: ../../advanced.rst:190
msgid ""
"If you want to store spatial information in a GIS database, Flask-Admin "
"has you covered. The GeoAlchemy backend extends the SQLAlchemy backend "
"(just as `GeoAlchemy <https://geoalchemy-2.readthedocs.io/>`_  extends "
"SQLAlchemy) to give you a pretty and functional map-based editor for your"
" admin pages."
msgstr ""
"如果你想在 GIS 数据库中存储空间信息，Flask-Admin 同样支持。GeoAlchemy 后端扩展了 "
"SQLAlchemy 后端 (类似 `GeoAlchemy <https://geoalchemy-2.readthedocs.io/>`_ "
"扩展了 SQLAlchemy )，为您的管理页面提供一个漂亮且功能强大的基于地图的编辑器。"

#: ../../advanced.rst:195
msgid "Some notable features include:"
msgstr "一些显著的功能包括:"

#: ../../advanced.rst:197
msgid ""
"Maps are displayed using the amazing `Leaflet <http://leafletjs.com/>`_ "
"Javascript library, with map data from `Mapbox "
"<https://www.mapbox.com/>`_."
msgstr ""
"使用惊人的 `Leaflet <http://leafletjs.com/>`_ Javascript 库显示地图，"
"地图数据来自 `Mapbox <https://www.mapbox.com/>`_。"

#: ../../advanced.rst:199
msgid ""
"Geographic information, including points, lines and polygons, can be "
"edited interactively using `Leaflet.Draw "
"<https://github.com/Leaflet/Leaflet.draw>`_."
msgstr ""
"地理信息，包括点，线和多边形，可以使用 `Leaflet.Draw "
"<https://github.com/Leaflet/Leaflet.draw>`_ 交互式编辑。"

#: ../../advanced.rst:201
msgid ""
"Graceful fallback: `GeoJSON <http://geojson.org/>`_ data can be edited in"
" a ``<textarea>``, if the user has turned off Javascript."
msgstr ""
"后备支持：如果用户已关闭 Javascript，则可以在 ``<textarea>`` 中编辑 "
"`GeoJSON <http://geojson.org/>`_ 数据。"

#: ../../advanced.rst:203
msgid ""
"Works with a `Geometry "
"<https://geoalchemy-2.readthedocs.io/en/latest/types.html#geoalchemy2.types.Geometry>`_"
" SQL field that is integrated with `Shapely "
"<http://toblerity.org/shapely/>`_ objects."
msgstr ""
"使用与 `Shapely <http://toblerity.org/shapely/>`_ 对象集成的 `Geometry "
"<https://geoalchemy-2.readthedocs.io/en/latest/types.html#geoalchemy2.types.Geometry>`_"
" SQL 字段。"

#: ../../advanced.rst:205
msgid ""
"To get started, define some fields on your model using GeoAlchemy's "
"*Geometry* field. Next, add model views to your interface using the "
"ModelView class from the GeoAlchemy backend, rather than the usual "
"SQLAlchemy backend::"
msgstr ""
"要开始使用，请使用 GeoAlchemy 的 *Geometry* 字段在模型上定义一些字段。"
"接下来，使用来自 GeoAlchemy 后端的 ModelView 类，而不是通常的 SQLAlchemy "
"后端，将模型视图添加到您的接口::"

#: ../../advanced.rst:220
msgid ""
"Some of the Geometry field types that are available include: \"POINT\", "
"\"MULTIPOINT\", \"POLYGON\", \"MULTIPOLYGON\", \"LINESTRING\" and "
"\"MULTILINESTRING\"."
msgstr ""
"可用的 Geometry 字段类型包括: \"POINT\", \"MULTIPOINT\", \"POLYGON\", "
"\"MULTIPOLYGON\", \"LINESTRING\" 和 \"MULTILINESTRING\"。"

#: ../../advanced.rst:223
msgid ""
"Have a look at https://github.com/flask-admin/flask-"
"admin/tree/master/examples/geo_alchemy to get started."
msgstr ""
"请查看 https://github.com/flask-admin/flask-admin/"
"tree/master/examples/geo_alchemy 示例以开始使用。"

#: ../../advanced.rst:227
msgid "Loading Tiles From Mapbox"
msgstr "从 Mapbox 加载地图"

#: ../../advanced.rst:229
msgid ""
"To have map data display correctly, you'll have to sign up for an account"
" at https://www.mapbox.com/ and include some credentials in your "
"application's config::"
msgstr ""
"要正确显示地图数据，您必须在 https://www.mapbox.com/ 注册帐户，"
"并在应用程序的配置中包含一些凭据::"

#: ../../advanced.rst:237
msgid ""
"Leaflet supports loading map tiles from any arbitrary map tile provider, "
"but at the moment, Flask-Admin only supports Mapbox. If you want to use "
"other providers, make a pull request!"
msgstr ""
"Leaflet 支持从任意地图图块 provider 程序加载地图图块，但目前 Flask-Admin 仅支持 "
"Mapbox。如果你想使用其他地图源，请提交 pull request！"

#: ../../advanced.rst:242
msgid "Limitations"
msgstr "限制"

#: ../../advanced.rst:244
msgid ""
"There's currently no way to sort, filter, or search on geometric fields "
"in the admin. It's not clear that there's a good way to do so. If you "
"have any ideas or suggestions, make a pull request!"
msgstr ""
"目前没有办法对 admin 中的 geometric 字段进行排序，过滤或搜索。不知道"
"有没有好方法解决该问题。如果您有任何想法或建议，请提出 pull request！"

#: ../../advanced.rst:249
msgid "Customising Builtin Forms Via Rendering Rules"
msgstr "通过渲染规则定制内置表单"

#: ../../advanced.rst:253
msgid ""
"Before version 1.0.7, all model backends were rendering the *create* and "
"*edit* forms using a special Jinja2 macro, which was looping over the "
"fields of a WTForms form object and displaying them one by one. This "
"works well, but it is difficult to customize."
msgstr ""
"在 1.0.7 版本前，所有模型后端都使用特殊的 Jinja2 宏来渲染 `create` 和 `edit` 表单，"
"该宏在 WTForms 表单对象的字段上循环，并逐个显示它们。这很好，但是很难定制。"

#: ../../advanced.rst:257
msgid ""
"Starting from version 1.0.7, Flask-Admin supports form rendering rules, "
"to give you fine grained control of how the forms for your modules should"
" be displayed."
msgstr ""
"从 1.0.7 版本开始，Flask-Admin 支持表单渲染规则，以便您对模块中的表单如何显示"
"进行细粒度的控制。"

#: ../../advanced.rst:260
msgid ""
"The basic idea is pretty simple: the customizable rendering rules replace"
" a static macro, so you can tell Flask-Admin how each form should be "
"rendered. As an extension, however, the rendering rules also let you do a"
" bit more: You can use them to output HTML, call Jinja2 macros, render "
"fields, and so on."
msgstr ""
"基本思想很简单：可自定义的渲染规则替换了静态宏，所以你可以告诉 "
"Flask-Admin 如何渲染每个表单。作为一个扩展，渲染规则还可以做更多事："
"你可以使用它们来输出 HTML，调用 Jinja2 宏，渲染字段等。"

#: ../../advanced.rst:264
msgid ""
"Essentially, form rendering rules separate the form rendering from the "
"form definition. For example, it no longer matters in which sequence your"
" form fields are defined."
msgstr ""
"基本上，表单渲染规则将表单渲染与表单定义分开。"
"明显的改善是，您的表单字段定义的顺序不再重要。"

#: ../../advanced.rst:267
msgid ""
"To start using the form rendering rules, put a list of form field names "
"into the `form_create_rules` property one of your admin views::"
msgstr ""
"要开始使用表单渲染规则，请在管理视图中，"
"将表单字段名列表放入 `form_create_rules` 属性中::"

#: ../../advanced.rst:273
msgid ""
"In this example, only three fields will be rendered and `email` field "
"will be above other two fields."
msgstr ""
"在此示例中，将仅渲染三个字段，并且 `email` 字段将高于其他两个字段。"

#: ../../advanced.rst:275
msgid ""
"Whenever Flask-Admin sees a string value in `form_create_rules`, it "
"automatically assumes that it is a form field reference and creates a "
":class:`flask_admin.form.rules.Field` class instance for that field."
msgstr ""
"每当 Flask-Admin 在 `form_create_rules` 中查看字符串值时，"
"它会假定值是一个表单字段引用，并为该字段创建一个 "
":class:`flask_admin.form.rules.Field` 类实例。"

#: ../../advanced.rst:278
msgid ""
"Let's say we want to display some text between the `email` and "
"`first_name` fields. This can be accomplished by using the "
":class:`flask_admin.form.rules.Text` class::"
msgstr ""
"假设我们要在 `email` 和 `first_name` 字段之间显示一些文本。"
"可以通过使用 :class:`flask_admin.form.rules.Text` 类来实现::"

#: ../../advanced.rst:287
msgid "Built-in Rules"
msgstr "内置规则"

#: ../../advanced.rst:289
msgid ""
"Flask-Admin comes with few built-in rules that can be found in the "
":mod:`flask_admin.form.rules` module:"
msgstr ""
"Flask-Admin 有一些内置规则，可以在 :mod:`flask_admin.form.rules` 模块中找到:"

#: ../../advanced.rst:292
msgid "Form Rendering Rule"
msgstr "表单渲染规则"

#: ../../advanced.rst:292
msgid "Description"
msgstr "描述"

#: ../../advanced.rst:294
msgid ":class:`flask_admin.form.rules.BaseRule`"
msgstr ":class:`flask_admin.form.rules.BaseRule`"

#: ../../advanced.rst:294
msgid "All rules derive from this class"
msgstr "所有规则都派生自该类"

#: ../../advanced.rst:295
msgid ":class:`flask_admin.form.rules.NestedRule`"
msgstr ":class:`flask_admin.form.rules.NestedRule`"

#: ../../advanced.rst:295
msgid "Allows rule nesting, useful for HTML containers"
msgstr "允许规则嵌套，适用于 HTML 容器"

#: ../../advanced.rst:296
msgid ":class:`flask_admin.form.rules.Text`"
msgstr ":class:`flask_admin.form.rules.Text`"

#: ../../advanced.rst:296
msgid "Simple text rendering rule"
msgstr "简单的文本渲染规则"

#: ../../advanced.rst:297
msgid ":class:`flask_admin.form.rules.HTML`"
msgstr ":class:`flask_admin.form.rules.HTML`"

#: ../../advanced.rst:297
msgid "Same as `Text` rule, but does not escape the text"
msgstr "与 `Text` 规则相同，但不转义文本"

#: ../../advanced.rst:298
msgid ":class:`flask_admin.form.rules.Macro`"
msgstr ":class:`flask_admin.form.rules.Macro`"

#: ../../advanced.rst:298
msgid "Calls macro from current Jinja2 context"
msgstr "从当前 Jinja2 上下文调用宏"

#: ../../advanced.rst:299
msgid ":class:`flask_admin.form.rules.Container`"
msgstr ":class:`flask_admin.form.rules.Container`"

#: ../../advanced.rst:299
msgid "Wraps child rules into container rendered by macro"
msgstr "将子规则包含到由宏渲染的容器中"

#: ../../advanced.rst:300
msgid ":class:`flask_admin.form.rules.Field`"
msgstr ":class:`flask_admin.form.rules.Field`"

#: ../../advanced.rst:300
msgid "Renders single form field"
msgstr "渲染单个表单字段"

#: ../../advanced.rst:301
msgid ":class:`flask_admin.form.rules.Header`"
msgstr ":class:`flask_admin.form.rules.Header`"

#: ../../advanced.rst:301
msgid "Renders form header"
msgstr "渲染表单标头"

#: ../../advanced.rst:302
msgid ":class:`flask_admin.form.rules.FieldSet`"
msgstr ":class:`flask_admin.form.rules.FieldSet`"

#: ../../advanced.rst:302
msgid "Renders form header and child rules"
msgstr "渲染表单标头和主体规则"

#: ../../advanced.rst:308
msgid "Using Different Database Backends"
msgstr "使用不同的数据库后端"

#: ../../advanced.rst:312
msgid ""
"Other than SQLAlchemy... There are five different backends for you to "
"choose from, depending on which database you would like to use for your "
"application. If, however, you need to implement your own database "
"backend, have a look at :ref:`adding-model-backend`."
msgstr ""
"除了 SQLAlchemy... 有五个不同的后端供您选择，具体取决于您的应用程序使用的数据库。"
"如果您需要实现自己的数据库后端，请查看 :ref:`adding-model-backend`。"

#: ../../advanced.rst:316
msgid ""
"If you don't know where to start, but you're familiar with relational "
"databases, then you should probably look at using `SQLAlchemy`_. It is a "
"full-featured toolkit, with support for SQLite, PostgreSQL, MySQL, Oracle"
" and MS-SQL amongst others. It really comes into its own once you have "
"lots of data, and a fair amount of relations between your data models. If"
" you want to track spatial data like latitude/longitude points, you "
"should look into `GeoAlchemy`_, as well."
msgstr ""
"如果您熟悉关系型数据库，那么应该使用 `SQLAlchemy`_。它是一个全功能的工具包，"
"支持 SQLite, PostgreSQL, MySQL, Oracle 和 MS-SQL 等数据库。如果您有很多"
"数据，并且数据模型之间有很多关系，应该使用 SQLAlchemy。如果要跟踪空间数据 "
"(如纬度/经度点)，则应使用 `GeoAlchemy`_。"

#: ../../advanced.rst:323
msgid "SQLAlchemy"
msgstr "SQLAlchemy"

#: ../../advanced.rst:325
msgid "Notable features:"
msgstr "特点:"

#: ../../advanced.rst:327
msgid "SQLAlchemy 0.6+ support"
msgstr "SQLAlchemy 0.6+ 支持"

#: ../../advanced.rst:328
msgid "Paging, sorting, filters"
msgstr "分页, 排序, 过滤"

#: ../../advanced.rst:329
msgid "Proper model relationship handling"
msgstr "正确的模型关系处理"

#: ../../advanced.rst:330
msgid "Inline editing of related models"
msgstr "相关模型的行内编辑"

#: ../../advanced.rst:332
msgid "**Multiple Primary Keys**"
msgstr "**多主键**"

#: ../../advanced.rst:334
msgid ""
"Flask-Admin has limited support for models with multiple primary keys. It"
" only covers specific case when all but one primary keys are foreign keys"
" to another model. For example, model inheritance following this "
"convention."
msgstr ""
"Flask-Admin 对多主键模型的支持有限。它只支持一个主键"
"是另一个模型的外键的特殊情况。例如，遵循此惯例的模型继承。"

#: ../../advanced.rst:338
msgid "Let's Model a car with its tyres::"
msgstr "让我们看看汽车及其轮胎的模型::"

#: ../../advanced.rst:355
msgid ""
"A specific tyre is identified by using the two primary key columns of the"
" ``Tyre`` class, of which the ``car_id`` key is itself a foreign key to "
"the class ``Car``."
msgstr ""
"通过使用 ``Tire`` 类的两个主键列来识别特定轮胎，"
"其中 ``car_id`` 键本身是 ``Car`` 类的外键。"

#: ../../advanced.rst:358
msgid ""
"To be able to CRUD the ``Tyre`` class, you need to enumerate columns when"
" defining the AdminView::"
msgstr ""
"为了能够对 ``Tire`` 类执行 CRUD，你需要在定义 AdminView 时枚举列::"

#: ../../advanced.rst:363
msgid ""
"The ``form_columns`` needs to be explicit, as per default only one "
"primary key is displayed."
msgstr ""
"``form_columns`` 需要显式指定，默认情况下只显示一个主键。"

#: ../../advanced.rst:365
msgid ""
"When having multiple primary keys, **no** validation for uniqueness "
"*prior* to saving of the object will be done. Saving a model that "
"violates a unique-constraint leads to an Sqlalchemy-Integrity-Error. In "
"this case, ``Flask-Admin`` displays a proper error message and you can "
"change the data in the form. When the application has been started with "
"``debug=True`` the ``werkzeug`` debugger will catch the exception and "
"will display the stacktrace."
msgstr ""
"当有多个主键时，在保存对象之前 **不会** 进行唯一性验证。保存违反唯一约束的模型"
"会导致 Sqlalchemy-Integrity-Error。在这种情况下，``Flask-Admin`` 显示正"
"确的错误消息，您可以更改表单中的数据。当应用程序以 ``debug=True`` 启动时， "
"``werkzeug`` 调试器将捕获异常并显示栈跟踪信息。"

#: ../../advanced.rst:371
msgid "MongoEngine"
msgstr "MongoEngine"

#: ../../advanced.rst:373
msgid ""
"If you're looking for something simpler than SQLAlchemy, and your data "
"models are reasonably self-contained, then `MongoDB "
"<https://www.mongodb.org/>`_, a popular *NoSQL* database, could be a "
"better option."
msgstr ""
"如果你需要比 SQLAlchemy 更简单的东西，你的数据模型是合理的自包含类型，"
"那么 `MongoDB <https://www.mongodb.org/>`_ 这个流行的 *NoSQL* 数"
"据库，或许是一个更好的选择。"

#: ../../advanced.rst:377
msgid ""
"`MongoEngine <http://mongoengine.org/>`_ is a python wrapper for MongoDB."
" For an example of using MongoEngine with Flask-Admin, see "
"https://github.com/flask-admin/flask-"
"admin/tree/master/examples/mongoengine."
msgstr ""
"`MongoEngine <http://mongoengine.org/>`_ 是 MongoDB 的 Python 封装。"
"在 Flask-Admin 中使用 MongoEngine 的示例，请参阅 https://github.com/"
"flask-admin/flask-admin/tree/master/examples/mongoengine。"

#: ../../advanced.rst:382 ../../advanced.rst:403
msgid "Features:"
msgstr "特性:"

#: ../../advanced.rst:384
msgid "MongoEngine 0.7+ support"
msgstr "MongoEngine 0.7+ 支持"

#: ../../advanced.rst:385
msgid "Paging, sorting, filters, etc"
msgstr "分页，排序，过滤等"

#: ../../advanced.rst:386
msgid "Supports complex document structure (lists, subdocuments and so on)"
msgstr "支持复杂的文档结构 (列表，子文档等等)"

#: ../../advanced.rst:387
msgid "GridFS support for file and image uploads"
msgstr "GridFS 支持存储上传的文件/图片"

#: ../../advanced.rst:389
msgid ""
"In order to use MongoEngine integration, install the `Flask-MongoEngine "
"<https://flask-mongoengine.readthedocs.io>`_ package. Flask-Admin uses "
"form scaffolding from it."
msgstr ""
"为了集成 MongoEngine，需要安装 `Flask-MongoEngine "
"<https://flask-mongoengine.readthedocs.io>`_ 包。"
"Flask-Admin 使用其中的表单脚手架。"

#: ../../advanced.rst:393 ../../advanced.rst:412
msgid "Known issues:"
msgstr "已知问题:"

#: ../../advanced.rst:395
msgid ""
"Search functionality can't split query into multiple terms due to "
"MongoEngine query language limitations"
msgstr ""
"由于 MongoEngine 查询语言的限制，搜索功能不能将查询拆分为多个条件"

#: ../../advanced.rst:398
msgid ""
"For more, check the :class:`~flask_admin.contrib.mongoengine` API "
"documentation."
msgstr ""
"更多信息，请参阅 :class:`~flask_admin.contrib.mongoengine` API 文档。"

#: ../../advanced.rst:401
msgid "Peewee"
msgstr "Peewee"

#: ../../advanced.rst:405
msgid "Peewee 2.x+ support;"
msgstr "Peewee 2.x+ 支持"

#: ../../advanced.rst:406
msgid "Paging, sorting, filters, etc;"
msgstr "分页，排序，过滤等"

#: ../../advanced.rst:407
msgid "Inline editing of related models;"
msgstr "相关模型的行内编辑"

#: ../../advanced.rst:409
msgid ""
"In order to use peewee integration, you need to install two additional "
"Python packages: `peewee <http://docs.peewee-orm.com/>`_ and `wtf-peewee "
"<https://github.com/coleifer/wtf-peewee/>`_."
msgstr ""
"为了使用 peewee，您需要安装 2 个 Python 包：`peewee "
"<http://docs.peewee-orm.com/>`_ 和 `wtf-peewee "
"<https://github.com/coleifer/wtf-peewee/>`_。"

#: ../../advanced.rst:414
msgid ""
"Many-to-Many model relations are not supported: there's no built-in way "
"to express M2M relation in Peewee"
msgstr ""
"不支持多对多模型关系：在 Peewee 中没有内置的方式来表达 M2M 关系"

#: ../../advanced.rst:416
msgid ""
"For more, check the :class:`~flask_admin.contrib.peewee` API "
"documentation. Or look at the Peewee example at https://github.com/flask-"
"admin/flask-admin/tree/master/examples/peewee."
msgstr ""
"更多信息，请参阅 :class:`~flask_admin.contrib.peewee` API 文档。"
"或查看 Peewee 使用示例 https://github.com/flask-admin/flask-admin/"
"tree/master/examples/peewee。"

#: ../../advanced.rst:420
msgid "PyMongo"
msgstr "PyMongo"

#: ../../advanced.rst:422
msgid "The bare minimum you have to provide for Flask-Admin to work with PyMongo:"
msgstr "Flask-Admin 使用 PyMongo 的最小要求:"

#: ../../advanced.rst:424
msgid "A list of columns by setting `column_list` property"
msgstr "设置 `column_list` 属性，值为字段列表"

#: ../../advanced.rst:425
msgid "Provide form to use by setting `form` property"
msgstr "设置 `form` 属性，值为要使用的表单"

#: ../../advanced.rst:426
msgid ""
"When instantiating :class:`flask_admin.contrib.pymongo.ModelView` class, "
"you have to provide PyMongo collection object"
msgstr ""
"当实例化 :class:`flask_admin.contrib.pymongo.ModelView` 类时，"
"你必须提供 PyMongo 集合对象"

#: ../../advanced.rst:428
msgid "This is minimal PyMongo view::"
msgstr "最简单的 PyMongo 视图:"

#: ../../advanced.rst:444
msgid "On top of that you can add sortable columns, filters, text search, etc."
msgstr "除此之外，您还可以添加可排序的列，过滤器，文本搜索等。"

#: ../../advanced.rst:446
msgid ""
"For more, check the :class:`~flask_admin.contrib.pymongoe` API "
"documentation. Or look at the Peewee example at https://github.com/flask-"
"admin/flask-admin/tree/master/examples/pymongo."
msgstr ""
"更多信息，请参阅 :class:`~flask_admin.contrib.pymongoe` API 文档。"
"或查看 PyMongo 使用示例 https://github.com/flask-admin/flask-admin/"
"tree/master/examples/pymongo。"

#: ../../advanced.rst:450
msgid "Migrating From Django"
msgstr "从 Django 迁移"

#: ../../advanced.rst:454
msgid ""
"If you are used to `Django <https://www.djangoproject.com/>`_ and the "
"*django-admin* package, you will find Flask-Admin to work slightly "
"different from what you would expect."
msgstr ""
"如果你习惯了 `Django <https://www.djangoproject.com/>`_ "
"和 *django-admin* 包，你会发现 Flask-Admin 的工作方式"
"与你期望的略有不同。"

#: ../../advanced.rst:458
msgid "Design Philosophy"
msgstr "设计哲学"

#: ../../advanced.rst:460
msgid ""
"In general, Django and *django-admin* strives to make life easier by "
"implementing sensible defaults. So a developer will be able to get an "
"application up in no time, but it will have to conform to most of the "
"defaults. Of course it is possible to customize things, but this often "
"requires a good understanding of what's going on behind the scenes, and "
"it can be rather tricky and time-consuming."
msgstr ""
"一般来说，Django 和 *django-admin* 有合理的默认值。因此，开发人员"
"能够立即获得应用程序，但它必须符合大多数默认值。如果需要定制，需要深刻的"
"理解后端的处理逻辑，这会相当耗时。"

#: ../../advanced.rst:465
msgid ""
"The design philosophy behind Flask is slightly different. It embraces the"
" diversity that one tends to find in web applications by not forcing "
"design decisions onto the developer. Rather than making it very easy to "
"build an application that *almost* solves your whole problem, and then "
"letting you figure out the last bit, Flask aims to make it possible for "
"you to build the *whole* application. It might take a little more effort "
"to get started, but once you've got the hang of it, the sky is the "
"limit... Even when your application is a little different from most other"
" applications out there on the web."
msgstr ""
"Flask 背后的设计理念略有不同。它倾向于使 web 应用程序更灵活，而不是"
"强制设计所有方面。Django 使您可以很容易构建应用程序，几乎替您解决了"
"所有问题；Flask 旨在使您控制构建整个应用程序。它需要学习更多内容，"
"一旦您了解了 Flask，您就可以开发任何类型的 Web 应用程序。"

#: ../../advanced.rst:472
msgid ""
"Flask-Admin follows this same design philosophy. So even though it "
"provides you with several tools for getting up & running quickly, it will"
" be up to you, as a developer, to tell Flask-Admin what should be "
"displayed and how. Even though it is easy to get started with a simple "
"`CRUD <http://en.wikipedia.org/wiki/Create,_read,_update_and_delete>`_ "
"interface for each model in your application, Flask-Admin doesn't fix you"
" to this approach, and you are free to define other ways of interacting "
"with some, or all, of your models."
msgstr ""
"Flask-Admin 遵循同样的设计理念。因此，即使它为您提供了几种快速启动和"
"运行的工具，作为开发人员，还是应该由您告诉 Flask-Admin 应该显示什么"
"以及如何显示。即使可以很容易的为应用程序的每个模型构建一个简单的 "
"`CRUD <http://en.wikipedia.org/wiki/Create,_read,_update_and_delete>`_ "
"接口，Flask-Admin 也不能完全解决所有问题，您可以灵活的定义与模块的交互方法，"
"来实现所有功能。"

#: ../../advanced.rst:478
msgid ""
"Due to Flask-Admin supporting more than one ORM (SQLAlchemy, MongoEngine,"
" Peewee, raw pymongo), the developer is even free to mix different model "
"types into one application by instantiating appropriate CRUD classes."
msgstr ""
"由于 Flask-Admin 支持多种 ORM (SQLAlchemy, MongoEngine, Peewee, raw pymongo)，"
"开发人员甚至可以通过实例化相应的 CRUD 类，将不同的模型类型混合到一个应用程序中。"

#: ../../advanced.rst:481
msgid ""
"Here is a list of some of the configuration properties that are made "
"available by Flask-Admin and the SQLAlchemy backend. You can also see "
"which *django-admin* properties they correspond to:"
msgstr ""
"以下是 Flask-Admin 和 SQLAlchemy 后端提供的一些配置属性的列表。"
"您还可以查看它们对应的 *django-admin* 属性:"

#: ../../advanced.rst:485
msgid "Django"
msgstr "Django"

#: ../../advanced.rst:485
msgid "Flask-Admin"
msgstr "Flask-Admin"

#: ../../advanced.rst:487
msgid "actions"
msgstr "actions"

#: ../../advanced.rst:487
msgid ":attr:`~flask_admin.actions`"
msgstr ":attr:`~flask_admin.actions`"

#: ../../advanced.rst:488
msgid "exclude"
msgstr "exclude"

#: ../../advanced.rst:488
msgid ":attr:`~flask_admin.model.BaseModelView.form_excluded_columns`"
msgstr ":attr:`~flask_admin.model.BaseModelView.form_excluded_columns`"

#: ../../advanced.rst:489
msgid "fields"
msgstr "fields"

#: ../../advanced.rst:489
msgid ":attr:`~flask_admin.model.BaseModelView.form_columns`"
msgstr ":attr:`~flask_admin.model.BaseModelView.form_columns`"

#: ../../advanced.rst:490
msgid "form"
msgstr "form"

#: ../../advanced.rst:490
msgid ":attr:`~flask_admin.model.BaseModelView.form`"
msgstr ":attr:`~flask_admin.model.BaseModelView.form`"

#: ../../advanced.rst:491
msgid "formfield_overrides"
msgstr "formfield_overrides"

#: ../../advanced.rst:491
msgid ":attr:`~flask_admin.model.BaseModelView.form_args`"
msgstr ":attr:`~flask_admin.model.BaseModelView.form_args`"

#: ../../advanced.rst:492
msgid "inlines"
msgstr "inlines"

#: ../../advanced.rst:492
msgid ":attr:`~flask_admin.contrib.sqla.ModelView.inline_models`"
msgstr ":attr:`~flask_admin.contrib.sqla.ModelView.inline_models`"

#: ../../advanced.rst:493
msgid "list_display"
msgstr "list_display"

#: ../../advanced.rst:493
msgid ":attr:`~flask_admin.model.BaseModelView.column_list`"
msgstr ":attr:`~flask_admin.model.BaseModelView.column_list`"

#: ../../advanced.rst:494
msgid "list_filter"
msgstr "list_filter"

#: ../../advanced.rst:494
msgid ":attr:`~flask_admin.contrib.sqla.ModelView.column_filters`"
msgstr ":attr:`~flask_admin.contrib.sqla.ModelView.column_filters`"

#: ../../advanced.rst:495
msgid "list_per_page"
msgstr "list_per_page"

#: ../../advanced.rst:495
msgid ":attr:`~flask_admin.model.BaseModelView.page_size`"
msgstr ":attr:`~flask_admin.model.BaseModelView.page_size`"

#: ../../advanced.rst:496
msgid "search_fields"
msgstr "search_fields"

#: ../../advanced.rst:496
msgid ":attr:`~flask_admin.model.BaseModelView.column_searchable_list`"
msgstr ":attr:`~flask_admin.model.BaseModelView.column_searchable_list`"

#: ../../advanced.rst:497
msgid "add_form_template"
msgstr "add_form_template"

#: ../../advanced.rst:497
msgid ":attr:`~flask_admin.model.BaseModelView.create_template`"
msgstr ":attr:`~flask_admin.model.BaseModelView.create_template`"

#: ../../advanced.rst:498
msgid "change_form_template"
msgstr "change_form_template"

#: ../../advanced.rst:498
msgid ":attr:`~flask_admin.model.BaseModelView.change_form_template`"
msgstr ":attr:`~flask_admin.model.BaseModelView.change_form_template`"

#: ../../advanced.rst:501
msgid ""
"You might want to check :class:`~flask_admin.model.BaseModelView` for "
"basic model configuration options (reused by all model backends) and "
"specific backend documentation, for example "
":class:`~flask_admin.contrib.sqla.ModelView`. There's much more than what"
" is displayed in this table."
msgstr ""
"您可能需要查看 :class:`~flask_admin.model.BaseModelView` "
"的基本模型配置选项 (由所有模型后端重用) 和特定的后端文档，例如 "
":class:`~flask_admin.contrib.sqla.ModelView`。了解更多的"
"模型配置选项。"

#: ../../advanced.rst:507
msgid "Overriding the Form Scaffolding"
msgstr "覆盖表单脚手架"

#: ../../advanced.rst:511
msgid ""
"If you don't want to the use the built-in Flask-Admin form scaffolding "
"logic, you are free to roll your own by simply overriding "
":meth:`~flask_admin.model.base.scaffold_form`. For example, if you use "
"`WTForms-Alchemy <https://github.com/kvesteri/wtforms-alchemy>`_, you "
"could put your form generation code into a `scaffold_form` method in your"
" `ModelView` class."
msgstr ""
"如果你不想使用 Flask-Admin 内置的表单框架逻辑，你可以通过简单覆盖 "
":meth:`~flask_admin.model.base.scaffold_form` 来自由滚动。例如，如果使用 "
"`WTForms-Alchemy <https://github.com/kvesteri/wtforms-alchemy>`_，您"
"可以将您的表单生成代码放入您的 `ModelView` 类中的 `scaffold_form` 方法。"

#: ../../advanced.rst:516
msgid ""
"For SQLAlchemy, if the `synonym_property` does not return a SQLAlchemy "
"field, then Flask-Admin won't be able to figure out what to do with it, "
"so it won't generate a form field. In this case, you would need to "
"manually contribute your own field::"
msgstr ""
"对于 SQLAlchemy，如果 `synonym_property` 不返回 SQLAlchemy 字段，那么 "
"Flask-Admin 将不知道该如何生成表单字段。在这种情况下，您需要手动提供自己的字段::"

#: ../../advanced.rst:526
msgid "Customizing Batch Actions"
msgstr "自定义批处理操作"

#: ../../advanced.rst:530
msgid ""
"If you want to add other batch actions to the list view, besides the "
"default delete action, then you can define a function that implements the"
" desired logic and wrap it with the `@action` decorator."
msgstr ""
"如果要向列表视图添加其他批处理操作，除了默认的删除操作，您可以"
"定义一个实现所需逻辑的函数，并使用 `@action` 装饰器将其包装。"

#: ../../advanced.rst:533
msgid ""
"The `action` decorator takes three parameters: `name`, `text` and "
"`confirmation`. While the wrapped function should accept only one "
"parameter - `ids`::"
msgstr ""
"`action` 装饰器需要三个参数: `name`, `text` 和 `confirmation`。"
"而被包装的函数只接受一个 `ids` 参数::"
