{
"info": {
"author": "Martin Aspeli",
"author_email": "optilude@gmail.com",
"bugtrack_url": null,
"classifiers": [
"Framework :: Plone",
"Framework :: Plone :: 5.1",
"Framework :: Plone :: 5.2",
"License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)",
"Programming Language :: Python",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Topic :: Software Development :: Libraries :: Python Modules"
],
"description": "plone.autoform\n==============\n\n.. contents:: Contents\n\nIntroduction\n------------\n\n``plone.autoform`` builds custom `z3c.form`_ forms based on a model (schema)\nof what fields to include and what widgets and options should be used for each\nfield. This model is defined as a `zope.schema`_-based schema, but additional\nhints can be supplied to control aspects of form display not normally specified\nin a Zope schema.\n\n\nBasic schema-based forms\n------------------------\n\nTo use the automatic form setup, mix in the following base class in your\nforms::\n\n >>> from plone.autoform.form import AutoExtensibleForm\n\nand then provide the ``schema`` (a schema interface) and optionally the\n``additionalSchemata`` (a list of schema interfaces) attributes on your form::\n\n class MyForm(AutoExtensibleForm, form.EditForm):\n schema = IMySchema\n additionalSchemata = (ISchemaOne, ISchemaTwo,)\n # ...\n\nFor dynamic forms, you could of course make ``schema`` and\n``additionalSchemata`` into properties. For example, `plone.dexterity`_ extends the\nbasic AutoExtensibleForm so that ``schema`` is the content type schema and\n``additionalSchemata`` is a list of field provider schemas associated with\nbehaviors.\n\n\nControlling form presentation\n-----------------------------\n\nDirectives can be specified in the schema to control aspects of form presentation.\n\nChanging a field's display mode\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nA field's widget can be displayed in several \"modes\":\n\n* input - allows the user to enter data into the field\n* display - a read-only indication of the field's value\n* hidden - a record of the field's value that is included only in the HTML source\n\nThe mode can be controlled using the ``mode`` directive::\n\n from plone.supermodel import model\n from plone.autoform import directives as form\n\n class IMySchema(model.Schema):\n\n form.mode(secret='hidden')\n form.mode(IEditForm, secret='input')\n secret = schema.TextLine(\n title=u\"Secret\",\n default=u\"Secret stuff (except on edit forms)\"\n )\n\nIn this case the mode for the ``secret`` field is set to 'hidden' for most forms,\nbut 'input' for forms that provide the IEditForm interface.\n\nThe corresponding supermodel XML directive is ``form:mode``::\n\n