flask-admin 1.4.2 - en to zh translation catalogue (120 entries)

en: Advanced Functionality
zh: 高级功能

en: Enabling CSRF Protection
zh: 启用 CSRF 保护

en: 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::
zh: 要向 *ModelView* 实例生成的表单添加 CSRF 保护，请在 *ModelView* 子类中将 *form_base_class* 参数值设为 SecureForm 类::

en: 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.
zh: SecureForm 需要 WTForms 2+。当表单提交时，它使用 WTForms SessionCSRF 类来生成和验证令牌。

en: Localization With Flask-Babelex
zh: 使用 Flask-Babelex 本地化

en: Flask-Admin comes with translations for several languages. Enabling localization is simple:
zh: Flask-Admin 提供多种语言的翻译。启用本地化非常简单:

en: 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::
zh: 安装 `Flask-BabelEx <http://github.com/mrjoes/flask-babelex/>`_ 扩展，它是 `Flask-Babel <http://github.com/mitshuhiko/flask-babel/>`_ 的分支::

en: Initialize Flask-BabelEx by creating instance of `Babel` class::
zh: 通过创建 `Babel` 类实例，初始化 Flask-BabelEx 扩展::

en: Create a locale selector function::
zh: 创建区域选择器函数::

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

en: 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.
zh: 继续，添加您的区域设置到语言选择器函数。应用程序可以将区域设置存储在用户 profile, cookie, session 中。它还可以使用 `Accept-Language` 头来自动选择语言。

en: 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.
zh: 如果内置的翻译不够，请查看 `Flask-BabelEx 文档 <https://pythonhosted.org/Flask-BabelEx/>`_ 了解如何添加翻译。

en: Managing Files & Folders
zh: 管理文件 & 目录

en: 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::
zh: 为了管理静态文件而不是数据库记录，Flask-Admin 附带了 FileAdmin 插件。它使您能够上传，删除，重命名文件。您可以通过向应用程序添加 FileAdmin 视图来使用该功能::

en: 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::
zh: FileAdmin 还具有管理 Amazon Simple Storage 服务的文件的开箱支持。将该功能添加到应用程序::

en: 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.
zh: 您可以配置禁用上传，禁用文件删除，限制上传文件的类型等功能。详细信息，请参阅 :mod:`flask_admin.contrib.fileadmin` API 文档。

en: Adding new file backends
zh: 添加新文件后端

en: 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.
zh: 您还可以通过继承 `LocalFileStorage` 类并重写其中的方法来实现自己的存储后端。有关方法的详细信息，请参阅 :mod:`flask_admin.contrib.fileadmin` API 文档。

en: Adding A Redis Console
zh: 添加 Redis 控制台

en: 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::
zh: 另一个可用的插件是 Redis 控制台。如果您的 Redis 实例与应用程序在同一个节点上运行，您可以::

en: Replacing Individual Form Fields
zh: 替换单个表单域

en: 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.
zh: `form_overrides` 属性允许您替换表单中的单个字段。一个常见的用例是添加一个 What-You-See-Is-What-You-Get (WYSIWIG, 所见即所得) 编辑器，或处理需要绑定到模型中的文件/图像上传字段。

en: WYSIWIG Text Fields
zh: WYSIWIG 文本字段

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

en: File & Image Fields
zh: 文件 & 图片字段

en: 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.
zh: Flask-Admin 内置有 :meth:`~flask_admin.form.upload.FileUploadField` 和 :meth:`~flask_admin.form.upload.ImageUploadField`。要使用它们，您需要指定一个上传目录，并将它们添加到表单中。如果您需要对图像文件进行处理，则需要安装 `Pillow <https://pypi.python.org/pypi/Pillow/>`_。

en: Have a look at the example at https://github.com/flask-admin/Flask-Admin/tree/master/examples/forms.
zh: 请查看 https://github.com/flask-admin/Flask-Admin/tree/master/examples/forms 示例。

en: 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`.
zh: 如果您使用 MongoEngine 后端，Flask-Admin 支持通过 WTForms 字段上传的文件/图片，保存在 GridFS 后端中。详细信息，请参阅 :mod:`flask_admin.contrib.mongoengine.fields` 文档。

en: 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.
zh: 如果您只想管理目录中的静态文件，而不是将其绑定到数据库模型，则使用 :ref:`File-Admin<file-admin>` 插件。

en: Managing Geographical Models
zh: 管理地理模型

en: 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.
zh: 如果你想在 GIS 数据库中存储空间信息，Flask-Admin 同样支持。GeoAlchemy 后端扩展了 SQLAlchemy 后端 (类似 `GeoAlchemy <https://geoalchemy-2.readthedocs.io/>`_ 扩展了 SQLAlchemy )，为您的管理页面提供一个漂亮且功能强大的基于地图的编辑器。

en: Some notable features include:
zh: 一些显著的功能包括:

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

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

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

en: 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.
zh: 使用与 `Shapely <http://toblerity.org/shapely/>`_ 对象集成的 `Geometry <https://geoalchemy-2.readthedocs.io/en/latest/types.html#geoalchemy2.types.Geometry>`_ SQL 字段。

en: 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::
zh: 要开始使用，请使用 GeoAlchemy 的 *Geometry* 字段在模型上定义一些字段。接下来，使用来自 GeoAlchemy 后端的 ModelView 类，而不是通常的 SQLAlchemy 后端，将模型视图添加到您的接口::

en: Some of the Geometry field types that are available include: "POINT", "MULTIPOINT", "POLYGON", "MULTIPOLYGON", "LINESTRING" and "MULTILINESTRING".
zh: 可用的 Geometry 字段类型包括: "POINT", "MULTIPOINT", "POLYGON", "MULTIPOLYGON", "LINESTRING" 和 "MULTILINESTRING"。

en: Have a look at https://github.com/flask-admin/flask-admin/tree/master/examples/geo_alchemy to get started.
zh: 请查看 https://github.com/flask-admin/flask-admin/tree/master/examples/geo_alchemy 示例以开始使用。

en: Loading Tiles From Mapbox
zh: 从 Mapbox 加载地图

en: 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::
zh: 要正确显示地图数据，您必须在 https://www.mapbox.com/ 注册帐户，并在应用程序的配置中包含一些凭据::

en: 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!
zh: Leaflet 支持从任意地图图块 provider 程序加载地图图块，但目前 Flask-Admin 仅支持 Mapbox。如果你想使用其他地图源，请提交 pull request！

en: Limitations
zh: 限制

en: 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!
zh: 目前没有办法对 admin 中的 geometric 字段进行排序，过滤或搜索。不知道有没有好方法解决该问题。如果您有任何想法或建议，请提出 pull request！

en: Customising Builtin Forms Via Rendering Rules
zh: 通过渲染规则定制内置表单

en: 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.
zh: 在 1.0.7 版本前，所有模型后端都使用特殊的 Jinja2 宏来渲染 `create` 和 `edit` 表单，该宏在 WTForms 表单对象的字段上循环，并逐个显示它们。这很好，但是很难定制。

en: 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.
zh: 从 1.0.7 版本开始，Flask-Admin 支持表单渲染规则，以便您对模块中的表单如何显示进行细粒度的控制。

en: 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.
zh: 基本思想很简单：可自定义的渲染规则替换了静态宏，所以你可以告诉 Flask-Admin 如何渲染每个表单。作为一个扩展，渲染规则还可以做更多事：你可以使用它们来输出 HTML，调用 Jinja2 宏，渲染字段等。

en: 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.
zh: 基本上，表单渲染规则将表单渲染与表单定义分开。明显的改善是，您的表单字段定义的顺序不再重要。

en: 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::
zh: 要开始使用表单渲染规则，请在管理视图中，将表单字段名列表放入 `form_create_rules` 属性中::

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

en: 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.
zh: 每当 Flask-Admin 在 `form_create_rules` 中查看字符串值时，它会假定值是一个表单字段引用，并为该字段创建一个 :class:`flask_admin.form.rules.Field` 类实例。

en: 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::
zh: 假设我们要在 `email` 和 `first_name` 字段之间显示一些文本。可以通过使用 :class:`flask_admin.form.rules.Text` 类来实现::

en: Built-in Rules
zh: 内置规则

en: Flask-Admin comes with few built-in rules that can be found in the :mod:`flask_admin.form.rules` module:
zh: Flask-Admin 有一些内置规则，可以在 :mod:`flask_admin.form.rules` 模块中找到:

en: Form Rendering Rule
zh: 表单渲染规则

en: Description
zh: 描述

en: All rules derive from this class
zh: 所有规则都派生自该类

en: Allows rule nesting, useful for HTML containers
zh: 允许规则嵌套，适用于 HTML 容器

en: Simple text rendering rule
zh: 简单的文本渲染规则

en: Same as `Text` rule, but does not escape the text
zh: 与 `Text` 规则相同，但不转义文本

en: Calls macro from current Jinja2 context
zh: 从当前 Jinja2 上下文调用宏

en: Wraps child rules into container rendered by macro
zh: 将子规则包含到由宏渲染的容器中

en: Renders single form field
zh: 渲染单个表单字段

en: Renders form header
zh: 渲染表单标头

en: Renders form header and child rules
zh: 渲染表单标头和主体规则

en: Using Different Database Backends
zh: 使用不同的数据库后端

en: 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`.
zh: 除了 SQLAlchemy... 有五个不同的后端供您选择，具体取决于您的应用程序使用的数据库。如果您需要实现自己的数据库后端，请查看 :ref:`adding-model-backend`。

en: 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.
zh: 如果您熟悉关系型数据库，那么应该使用 `SQLAlchemy`_。它是一个全功能的工具包，支持 SQLite, PostgreSQL, MySQL, Oracle 和 MS-SQL 等数据库。如果您有很多数据，并且数据模型之间有很多关系，应该使用 SQLAlchemy。如果要跟踪空间数据 (如纬度/经度点)，则应使用 `GeoAlchemy`_。

en: Notable features:
zh: 特点:

en: SQLAlchemy 0.6+ support
zh: SQLAlchemy 0.6+ 支持

en: Paging, sorting, filters
zh: 分页, 排序, 过滤

en: Proper model relationship handling
zh: 正确的模型关系处理

en: Inline editing of related models
zh: 相关模型的行内编辑

en: **Multiple Primary Keys**
zh: **多主键**

en: 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.
zh: Flask-Admin 对多主键模型的支持有限。它只支持一个主键是另一个模型的外键的特殊情况。例如，遵循此惯例的模型继承。

en: Let's Model a car with its tyres::
zh: 让我们看看汽车及其轮胎的模型::

en: 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``.
zh: 通过使用 ``Tire`` 类的两个主键列来识别特定轮胎，其中 ``car_id`` 键本身是 ``Car`` 类的外键。

en: To be able to CRUD the ``Tyre`` class, you need to enumerate columns when defining the AdminView::
zh: 为了能够对 ``Tire`` 类执行 CRUD，你需要在定义 AdminView 时枚举列::

en: The ``form_columns`` needs to be explicit, as per default only one primary key is displayed.
zh: ``form_columns`` 需要显式指定，默认情况下只显示一个主键。

en: 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.
zh: 当有多个主键时，在保存对象之前 **不会** 进行唯一性验证。保存违反唯一约束的模型会导致 Sqlalchemy-Integrity-Error。在这种情况下，``Flask-Admin`` 显示正确的错误消息，您可以更改表单中的数据。当应用程序以 ``debug=True`` 启动时， ``werkzeug`` 调试器将捕获异常并显示栈跟踪信息。

en: 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.
zh: 如果你需要比 SQLAlchemy 更简单的东西，你的数据模型是合理的自包含类型，那么 `MongoDB <https://www.mongodb.org/>`_ 这个流行的 *NoSQL* 数据库，或许是一个更好的选择。

en: `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.
zh: `MongoEngine <http://mongoengine.org/>`_ 是 MongoDB 的 Python 封装。在 Flask-Admin 中使用 MongoEngine 的示例，请参阅 https://github.com/flask-admin/flask-admin/tree/master/examples/mongoengine。

en: Features:
zh: 特性:

en: MongoEngine 0.7+ support
zh: MongoEngine 0.7+ 支持

en: Paging, sorting, filters, etc
zh: 分页，排序，过滤等

en: Supports complex document structure (lists, subdocuments and so on)
zh: 支持复杂的文档结构 (列表，子文档等等)

en: GridFS support for file and image uploads
zh: GridFS 支持存储上传的文件/图片

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

en: Known issues:
zh: 已知问题:

en: Search functionality can't split query into multiple terms due to MongoEngine query language limitations
zh: 由于 MongoEngine 查询语言的限制，搜索功能不能将查询拆分为多个条件

en: For more, check the :class:`~flask_admin.contrib.mongoengine` API documentation.
zh: 更多信息，请参阅 :class:`~flask_admin.contrib.mongoengine` API 文档。

en: Peewee 2.x+ support;
zh: Peewee 2.x+ 支持

en: Paging, sorting, filters, etc;
zh: 分页，排序，过滤等

en: Inline editing of related models;
zh: 相关模型的行内编辑

en: 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/>`_.
zh: 为了使用 peewee，您需要安装 2 个 Python 包：`peewee <http://docs.peewee-orm.com/>`_ 和 `wtf-peewee <https://github.com/coleifer/wtf-peewee/>`_。

en: Many-to-Many model relations are not supported: there's no built-in way to express M2M relation in Peewee
zh: 不支持多对多模型关系：在 Peewee 中没有内置的方式来表达 M2M 关系

en: 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.
zh: 更多信息，请参阅 :class:`~flask_admin.contrib.peewee` API 文档。或查看 Peewee 使用示例 https://github.com/flask-admin/flask-admin/tree/master/examples/peewee。

en: The bare minimum you have to provide for Flask-Admin to work with PyMongo:
zh: Flask-Admin 使用 PyMongo 的最小要求:

en: A list of columns by setting `column_list` property
zh: 设置 `column_list` 属性，值为字段列表

en: Provide form to use by setting `form` property
zh: 设置 `form` 属性，值为要使用的表单

en: When instantiating :class:`flask_admin.contrib.pymongo.ModelView` class, you have to provide PyMongo collection object
zh: 当实例化 :class:`flask_admin.contrib.pymongo.ModelView` 类时，你必须提供 PyMongo 集合对象

en: This is minimal PyMongo view::
zh: 最简单的 PyMongo 视图:

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

en: 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.
zh: 更多信息，请参阅 :class:`~flask_admin.contrib.pymongoe` API 文档。或查看 PyMongo 使用示例 https://github.com/flask-admin/flask-admin/tree/master/examples/pymongo。

en: Migrating From Django
zh: 从 Django 迁移

en: 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.
zh: 如果你习惯了 `Django <https://www.djangoproject.com/>`_ 和 *django-admin* 包，你会发现 Flask-Admin 的工作方式与你期望的略有不同。

en: Design Philosophy
zh: 设计哲学

en: 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.
zh: 一般来说，Django 和 *django-admin* 有合理的默认值。因此，开发人员能够立即获得应用程序，但它必须符合大多数默认值。如果需要定制，需要深刻的理解后端的处理逻辑，这会相当耗时。

en: 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.
zh: Flask 背后的设计理念略有不同。它倾向于使 web 应用程序更灵活，而不是强制设计所有方面。Django 使您可以很容易构建应用程序，几乎替您解决了所有问题；Flask 旨在使您控制构建整个应用程序。它需要学习更多内容，一旦您了解了 Flask，您就可以开发任何类型的 Web 应用程序。

en: 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.
zh: Flask-Admin 遵循同样的设计理念。因此，即使它为您提供了几种快速启动和运行的工具，作为开发人员，还是应该由您告诉 Flask-Admin 应该显示什么以及如何显示。即使可以很容易的为应用程序的每个模型构建一个简单的 `CRUD <http://en.wikipedia.org/wiki/Create,_read,_update_and_delete>`_ 接口，Flask-Admin 也不能完全解决所有问题，您可以灵活的定义与模块的交互方法，来实现所有功能。

en: 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.
zh: 由于 Flask-Admin 支持多种 ORM (SQLAlchemy, MongoEngine, Peewee, raw pymongo)，开发人员甚至可以通过实例化相应的 CRUD 类，将不同的模型类型混合到一个应用程序中。

en: 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:
zh: 以下是 Flask-Admin 和 SQLAlchemy 后端提供的一些配置属性的列表。您还可以查看它们对应的 *django-admin* 属性:

en: 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.
zh: 您可能需要查看 :class:`~flask_admin.model.BaseModelView` 的基本模型配置选项 (由所有模型后端重用) 和特定的后端文档，例如 :class:`~flask_admin.contrib.sqla.ModelView`。了解更多的模型配置选项。

en: Overriding the Form Scaffolding
zh: 覆盖表单脚手架

en: 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.
zh: 如果你不想使用 Flask-Admin 内置的表单框架逻辑，你可以通过简单覆盖 :meth:`~flask_admin.model.base.scaffold_form` 来自由滚动。例如，如果使用 `WTForms-Alchemy <https://github.com/kvesteri/wtforms-alchemy>`_，您可以将您的表单生成代码放入您的 `ModelView` 类中的 `scaffold_form` 方法。

en: 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::
zh: 对于 SQLAlchemy，如果 `synonym_property` 不返回 SQLAlchemy 字段，那么 Flask-Admin 将不知道该如何生成表单字段。在这种情况下，您需要手动提供自己的字段::

en: Customizing Batch Actions
zh: 自定义批处理操作

en: 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.
zh: 如果要向列表视图添加其他批处理操作，除了默认的删除操作，您可以定义一个实现所需逻辑的函数，并使用 `@action` 装饰器将其包装。

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