[Zope3-Users] Selecting a Vocabulary for a Choice field upon the value of another field
Fred Drake
fdrake at gmail.com
Fri May 1 08:11:24 EDT 2009
On Fri, May 1, 2009 at 7:57 AM, Massimiliano della Rovere
<massimiliano.dellarovere at gmail.com> wrote:
> One of the the fields describing the wine, the colour of the wine
> (field: wine_colour), is implemented like a Choice field.
> Red, white and roseé wines (field: wine_type) have different possible
> shades of colour and I have one vocabulary devoted to each kind of
> wine.
Another approach would be to have a vocabulary that embodies more
domain knowledge. The values could be (color, shade) pairs. Creating
a specific kind of zope.schema field for that is fairly
straightforward, and would allow registering a specialized widget that
supports the UI you're interested in (possibly using a bit of
JavaScript on the client as well).
-Fred
--
Fred L. Drake, Jr. <fdrake at gmail.com>
"Chaos is the score upon which reality is written." --Henry Miller
More information about the Zope3-users
mailing list