Re: ChoiceField and the use of sources/vocabularies

Philipp von Weitershausen <[email protected]> Sun, 14 Oct 2007 13:56:44 +0200
Newsgroups gmane.comp.web.zope.zope3
Message-ID <[email protected]>
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