[Zope3-dev] Re: a plan for widgets?

Martijn Faassen faassen at infrae.com
Fri Mar 17 04:14:13 EST 2006


Jeff Shell wrote:

>>Martijn Faassen wrote:
>>>* sources and terms are nice, but we should at least provide some basic
>>>sources and register some basic terms for them; that bit is completely
>>>missing in Zope 3 right now. People should be able to at make a simple
>>>drop-down widget happen without having to figure out how to tie all
>>>these components together - they should just import and use the right
>>>source, perhaps import, use, and register the right term, and there they
>>>go.
> 
> 
> Um. Straight up sources are pretty easy, especially when you use terms
> directly. We have a few Choice (and our own 'RelaxedChoice') fields in
> one application that get their values, at present, from tuples in a
> ``values.py`` file. ``values=values.area_codes``. Works fine for
> straight and simple sources.

I understand that sources are not too complicated, but it doesn't really 
help that Zope 3 right now only provides interfaces for both sources and 
terms. You'll have to do the implementation of a source, and an ITerms 
yourself, and register it yourself. I just see I'm not entirely right; 
in vocabulary.py there is SimpleTerm implementation of ITokenizedTerm. 
Still, I'd like there to be something more useful out of the box.

> The problem I have with vocabularies is, ahem, the vocabulary. "they
> should just import and use the right source, perhaps import, use, and
> register the right term, and there they go"... what? As I mention
> below, I've ultimately started to find Vocabularies very useful. But I
> also found them incredibly daunting with a surprisingly high entry
> barrier. Terms, Tokens, Titles, deferred vocabulary loading and
> binding, direct vocabulary-field binding, the vocabulary registry
> (versus the Utility registry), the different vocabulary registry set
> up in zope.app, ... It's been hard to control and understand. And
> especially (strangely) hard to learn by interaction in the Python
> interpreter.

As far as I understood, vocabularies are on the way out in Zope 3.3:

in zope.schema.interfaces:

# BBB vocabularies are pending deprecation, hopefully in 3.3

I may have this wrong, but that's what I read in the code. We've used 
vocabularies before, but apparently they're deprecated.

Regards,

Martijn


More information about the Zope3-dev mailing list