Skip to main content

An uberselection widget for z3c.form.

Project description

Overview

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 collective.formwidget.uberselect.archetypes import \
...     ArchetypesContentSourceBinder
>>> class ISelection(interface.Interface):
...     items = schema.Set(
...         title=u"Selection",
...         description=u"Search for content.",
...         value_type=schema.Choice(
...             source=ArchetypesContentSourceBinder()
...         )
...     )

Weak references

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 collective.formwidget.uberselect.wref 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.

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

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

Source Distribution

collective.formwidget.uberselect-0.1.tar.gz (3.0 kB view details)

Uploaded Source

File details

Details for the file collective.formwidget.uberselect-0.1.tar.gz.

File metadata

File hashes

Hashes for collective.formwidget.uberselect-0.1.tar.gz
Algorithm Hash digest
SHA256 04fde5bbcf4bead5af684b5aee58d9a68894e24b8321f2423100cab514481671
MD5 97845c34549a29d71e103e65bf7d3988
BLAKE2b-256 4e8516310ddace0d6a732990c314ae5122491204fe6492ea36d612ad51d68346

See more details on using hashes here.

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