Skip to main content

A library that allows use of z3c.form with Zope 2 and Plone

Project description

plone.z3cform

plone.z3cform is a library that allows use of z3c.form with Zope 2 and Plone.

More documentation to come. For now, please refer to the collective.dancing package for examples of use.

Uberselection widget

This package provides a query source compatible with z3c.formwidget.query which combines to an uberselection widget for the z3c.form form generation framework.

The native value type for the widget is Archetypes UID collections.

Example:

>>> from plone.z3cform.uberselect import \
...     ArchetypesContentSourceBinder
>>> class ISelection(interface.Interface):
...     items = schema.Set(
...         title=u"Selection",
...         description=u"Search for content.",
...         value_type=schema.Choice(
...             source=ArchetypesContentSourceBinder()
...         )
...     )

A recipe to store references as persistent.wref.WeakRef instead of UID is to use the uid2wref adapter between the form and the context.

>>> from plone.z3cform.uberselect import uid2wref
>>> Factory = uid2wref(ISelection['items'])

To store weak references instead of UIDs you would register such a factory as a component adapting the context. The factory automatically provides the interface which defines the field.

Changelog

0.1 - Unreleased

  • Added Archetypes reference selection widget (uberselection) [malthe]

  • Initial release

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

plone.z3cform-0.1b4.tar.gz (22.0 kB view details)

Uploaded Source

File details

Details for the file plone.z3cform-0.1b4.tar.gz.

File metadata

File hashes

Hashes for plone.z3cform-0.1b4.tar.gz
Algorithm Hash digest
SHA256 021641c00a01ec5aa2c9e2488255058b5ecadf36fd39c9a61e1841f47a122548
MD5 99dec3cbc026a628aed177f54f5c423c
BLAKE2b-256 bd8fdfb085f65363f52c357c543206e1628fce468735f6a48dbb3164d0f76ad6

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page