Skip to main content

This package let you defines forms containing other forms in zeam.form.base.

Example

Here a simple example. Let’s define a setting form:

from zeam.form import composed, base
from zope.interface import Interface


class Setting(composed.ComposedForm):
    composed.context(Interface)

    label = u"Settings"

After, a module can add some mail settings on that screen:

class MailSetting(composed.SubForm):
    composed.context(MyApplication)
    composed.view(Setting)
    composed.order(99)

    label = u"Mail delivery settings"
    ...

And publications of that application could add some publication settings:

class PublicationSetting(composed.SubForm):
    composed.context(MyPublications)
    composed.view(Setting)
    composed.order(10)

    label = u"Publication settings"
    ...

Some default templates are included as well, but you can replace like you will do in zeam.form.base.

API

Classes

ComposedForm

This class define a form which able to contain other forms. It behave like a zeam.form.base Form, but does use its fields. A usefull method can give you back a given subform : getSubForm(identifier).

SubForm

This class represent a form which is contained inside a ComposedForm. This form behave exactly like a zeam.form.base Form to which you add:

  • a method available() which is called before anything else to know if the form shoud still be included in the ComposedForm.

  • a method getComposedForm() that gives you back the composed form in which this form is rendered.

SubFormGroup

This class let you group SubForm together. They are rendered within the group template, and prefixed by the group name. Like a SubForm they have an available() and a getComposedForm() method. It as well have a getSubForm(identifier) method.

Directives

All those directives comes from Grokcore component. Please refer to the Grok documentation for more information.

context

Define for which object the form/sub form is available.

layer

Define the skin for which the form/sub form is aviable.

require

Define a permission need to access the form.

template

Define a Grok-like template for the form. After you done that, the Grok template will be look up and used. You can’t use anymore a megrok.pagetemplate template, unless you set template=None again on your form class.

view

On a sub form, define for which form the sub form is available.

order

Let you specify a number to sort your sub form afterwards using that setting.

Changelog

1.3.3 (2019/01/15)

  • Updated versions of GTK packages.

1.3.2 (2012/05/02)

  • Update to use the latest grokcore.component.

1.3.1 (2012/04/27)

  • Now use grokcore.chameleon instead of megrok.chameleon.

1.3 (2011/11/08)

  • Fix various stupid bugs.

  • Fix available issue after executing actions.

  • Properly support zeam.form.base 1.2 (actions return the sub form on which the action have been executed).

  • Updates tests.

1.2 (2010/10/19)

  • Add the concept of groups : subforms in a composed one can be grouped with them : they act as a composed form to the subform, and a subform to the composed form.

  • Update default templates to reflect changes in zeam.form.base.

1.1 (2010/07/16)

  • Default templates now use Chameleon.

  • Call update for all subforms when the update of the composed form is called.

1.0 (2010/05/03)

  • Initial release.

Metadata

Release files for zeam.form.composed 1.3.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for zeam.form.composed 1.3.3
File Size Uploaded Provenance Actions
zeam.form.composed-1.3.3.tar.gz 12.0 kB Without provenance Details for zeam.form.composed-1.3.3.tar.gz

Release files / zeam.form.composed-1.3.3.tar.gz

Download URL zeam.form.composed-1.3.3.tar.gz
Size 12.0 kB
Tags Source
SHA-256 checksum
How to use checksums
833a9912b1e95d94b5623182ee3d38e8ceb6ad0ea482d8b99070a1c9f19eac1e
BLAKE2b-256 checksum
How to use checksums
bccaba362d3a28e0c2f9bf0e3b3aaa74f1777a40e18dcdbcdf826a6751e1b5f8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Python-urllib/2.7

Security for zeam.form.composed 1.3.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page