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
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file Products.PFGMasterSelect-0.2.tar.gz
.
File metadata
- Download URL: Products.PFGMasterSelect-0.2.tar.gz
- Upload date:
- Size: 13.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ab6042afd28426cddd3a99297c24e4330d42b12023292f779f33465077aed8ec |
|
MD5 | a9a80c0bce983572116e04f71df84b9b |
|
BLAKE2b-256 | 2c6d5f145b32a14ae7f1ddde01fd33ce6e3bdb86401a7ef00990f54bc949c553 |