Giter Club home page Giter Club logo

zeam-form-autofields's Introduction

====================
zeam.form.autofields
====================

``zeam.form.autofields`` is able to collect fields definition for your
form. This enable you to create forms with a plugable list of fields.

.. contents::

Example
=======

You need first to define a group of fields. This will be just an
interface::

  >>> from zope.interface import Interface

  >>> class IReplyFields(Interface):
  ...    pass

Now you can define groups of fields::

  >>> from zeam.form import base, autofields

  >>> class ReplyInformation(autofields.AutoFields):
  ...     autofields.group(IReplyFields)
  ...     autofields.order(0)
  ...     fields = base.Fields(base.Field('Comment'))

  >>> class ReplyBlogInformation(autofields.AutoFields):
  ...     autofields.group(IReplyFields)
  ...     autofields.order(10)
  ...     fields = base.Fields(base.Field('Blog URL'))

And you will be able to use those fields on your form somewhere else::

  >>> class ReplyForm(base.Form):
  ...     fields = autofields.FieldsCollector(IReplyFields)

API
===

In addition to its API, ``zeam.form.autofields`` export the one of
``zeam.form.base``.

Classes
-------

``AutoFields``
   Base classes used to define a group of Fields to be included in a form.

Directives
----------

``group``
   Directive used on ``AutoFields`` which select for which group you
   whish to provide the fields for. A group is just a plain zope
   interface, that will be given as parameter to the
   ``FieldsCollector``.

``view``
   Directive used on ``AutoFields`` that will let you specify for
   which Form (or view) you whish to provide the fields for. This
   directive is not required, and default to ``IBrowserView``.

``order``
   Optional directive which let decide in wich order the fields will
   included at the end.

Properties
----------

``FieldsCollector``
   Property used to collect form Fields for you.

zeam-form-autofields's People

Contributors

gwik avatar thefunny42 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.