Skip to main content

Plone Formgen Fields using Master Select Widgets

Project description

Products.PFGMasterSelect

An add-on field for PloneFormGen using the MasterSelect widget.

Features

Installation

How to use

Please note that PloneFormGen’s QuickEdit mode does not work (yet) for this add-on.

After installing this product you can create the Master Select and Master Multiselect fields via the “Add new…” menu in a PloneFormGen form. Both fields allow you to specify a default value and the options available as the common selection field does.

Additionally it provides a configuration table that contains the MasterSelect configuration (see also MasterSelectWidget documentation for more detail):

name (required)

The target field’s name

action (required)

The action to be applied on the target field. The options are * show/enable: Show/Enable the target field only if toggle_method evaluates to True or the field’s value is in hide_value * hide/disable: Hide/disable the target field if toggle_method evaluates to True or the field’s value is in hide_values * value: Set the target field’s value to the result of the vocab_method * vocabulary: Set the target field’s vocabulary to the result of the vocab_method

vocab_method

A python expression evaluating to a single value or collection. The currently set value (MasterSelect) or values (MasterMultiSelect) are available via value and values respectively. Example: Set the vocabulary of a selection field using ['xyz' + v for v in values]

toggle_method

A python expression evaluating to a boolean value. This method takes precedence to hide_values. The currently set value (MasterSelect) or values (MasterMultiSelect) are available via value and values respectively. Example: Hide a field if the selected value has length 5 or equals foo using len(value) == 5 or value == 'foo'

hide_values

The values that show/hide/enable/disable operate on Example: Hide a field if the selected value is a or b using a,b

Change history

Changelog

0.2 (2017-05-19)

  • Fix bug related to Datagridfield providing empty rows

  • Fix type confusion after roundtrip by forcing every value to type string

  • Use plain string comparison for hide_values instead of python expressions evaluating to a value or a collection

  • Refine the slave fields widget descriptions regarding the method fields

  • Replace eval by Plone’s tales expressions

  • Add documentation

0.1 (2017-03)

  • Proof of concept

Contributors

“”, Author

Download

Project details


Release history Release notifications | RSS feed

This version

0.2

Download files

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

Source Distribution

Products.PFGMasterSelect-0.2.tar.gz (13.9 kB view hashes)

Uploaded Source

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