zeam.form.composed
==================

Composed Form
-------------

This package let you compose more than one form inside an another form.

   >>> from zeam.form.composed import ComposedForm
   >>> from zeam.form.composed import interfaces
   >>> from zope.publisher.browser import TestRequest

   >>> class MyComplexForm(ComposedForm):
   ...    label = u"Complex form"

   >>> request = TestRequest()
   >>> form = MyComplexForm(object(), request)
   >>> form
   <MyComplexForm object at ...>

And this implement correctly the form API:

   >>> from zeam.form.base.interfaces import IForm
   >>> from zope.interface.verify import verifyObject

   >>> verifyObject(interfaces.IComposedForm, form)
   True

   >>> interfaces.IComposedForm.extends(IForm)
   True


Sub Form
--------

A subform goes inside a composed form:

   >>> from zeam.form.composed import SubForm
   >>> from zeam.form.base.interfaces import IFormCanvas

   >>> class MySubForm(SubForm):
   ...    label = u"Sub form"

   >>> subform = MySubForm(object(), request, form)
   >>> subform
   <MySubForm object at ...>

And like a composed form this reply to the form API:

   >>> verifyObject(interfaces.ISubForm, subform)
   True

   >>> interfaces.ISubForm.extends(IFormCanvas)
   True


Sub Form Group
--------------

A group of subforms is a logical ensemble of subforms, that can be
nested. They behave like a normal subforms but have some extra
attributes::

   >>> from zeam.form.composed import SubFormGroup

   >>> class MySubFormGroup(SubFormGroup):
   ...    label = u"Group of sub forms"

   >>> group = MySubFormGroup(object(), request, form)
   >>> group
   <MySubFormGroup object at ...>
