Adds a choice widget with text field to z3cform.
Project description
Introduction
============
This product adds a z3c.form widget (called an Addable Choice Widget) that provides a
text input in which the user can enter a new value, but also a dropdown in
which previously added values are shown.
The user therefore has the choice to use a value previously given, or to give a
new value.
When this widget is used for the first time, the dropdown will of course be
empty, as there won't be any previously added values.
How to use:
-----------
from plone.directives import form
from collective.z3cform.addablechoice.widget import AddableChoiceFieldWidget
class IMyType(form.Schema):
""" """
product_name = schema.TextLine(
title=_(u'label_product_name', default=u'Product Name'),
)
form.widget(product_name=AddableChoiceFieldWidget)
Changelog
=========
0.5 (2013-03-18)
----------------
- Fail gracefully when there is no index or now values to choose from.
[jcbrand]
0.4 (2012-08-02)
----------------
- Explicitly check if request value is list/tuple. [jcbrand]
0.3 (2012-03-22)
----------------
- Edit MANIFEST.in to include profiles dir. [jcbrand]
0.2 (2012-03-21)
----------------
- Add MANIFEST.in to explicitly add docs dir. [jcbrand]
0.1 (2012-03-21)
----------------
- Created [jbeyers]
- Initial release [jcbrand]
============
This product adds a z3c.form widget (called an Addable Choice Widget) that provides a
text input in which the user can enter a new value, but also a dropdown in
which previously added values are shown.
The user therefore has the choice to use a value previously given, or to give a
new value.
When this widget is used for the first time, the dropdown will of course be
empty, as there won't be any previously added values.
How to use:
-----------
from plone.directives import form
from collective.z3cform.addablechoice.widget import AddableChoiceFieldWidget
class IMyType(form.Schema):
""" """
product_name = schema.TextLine(
title=_(u'label_product_name', default=u'Product Name'),
)
form.widget(product_name=AddableChoiceFieldWidget)
Changelog
=========
0.5 (2013-03-18)
----------------
- Fail gracefully when there is no index or now values to choose from.
[jcbrand]
0.4 (2012-08-02)
----------------
- Explicitly check if request value is list/tuple. [jcbrand]
0.3 (2012-03-22)
----------------
- Edit MANIFEST.in to include profiles dir. [jcbrand]
0.2 (2012-03-21)
----------------
- Add MANIFEST.in to explicitly add docs dir. [jcbrand]
0.1 (2012-03-21)
----------------
- Created [jbeyers]
- Initial release [jcbrand]
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
File details
Details for the file collective.z3cform.addablechoice-0.5.zip
.
File metadata
- Download URL: collective.z3cform.addablechoice-0.5.zip
- Upload date:
- Size: 14.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b46b580c68337b2e421f17eec4de21cbbb396adc69942b2eed3176db2f677653 |
|
MD5 | 2817b390ba3e6031d6780ff480c23471 |
|
BLAKE2b-256 | 8e1d7438d221e492ad9079bc411212410fb03826814136996dc42d520555d0c6 |