[Zope3-dev] Re: ChoiceField and the use of sources/vocabularies

Philipp von Weitershausen philipp at weitershausen.de
Sun Oct 14 07:56:44 EDT 2007


Christian Zagrodnick wrote:
> Actually you cannot make sources more straightforward as 
> zc.sourcefactory made it.

I agree. It's very nice.

> So, when the contract is ISource, a widget would need to adapt 
> choice.vocabulary to IIterableSource to get the values. For terms it 
> should multiadapt (choice.voabulary, request) to 
> zope.app.form.browser.interfaces.ITerms.
> 
> There probably could be standard adapters for:
> 
> IIterableVocabulary -> IIterableSource
> IVocabularyTokenized -> ITerms (using multi adapter of (vocab, request))

That sounds like a sensible solution.

> We also might think about not using choice.vocabulary but choice.source 
> ... but that might break quite a lot more....

Yup, therefore -1.

Probably-my-last-post-to-zope3-dev-ly,
Philipp


-- 
http://worldcookery.com -- Professional Zope documentation and training


More information about the Zope3-dev mailing list