[Product-Developers] Named vocabularies, dexterity, autocompletewidget...

David Glick (GW) davidglick at groundwire.org
Wed Jan 18 18:25:14 UTC 2012


On Jan 18, 2012, at 3:56 AM, Paul Roeland wrote:

> for future reference, and to help others:
>
> - autocompletewidget requires an IQuerySource-providing object
> - that needs to have a 'search()' method
> - and then needs to be bound like this:
>
> class myfancySourceBinder(object):
>    implements(IContextSourceBinder)
>
>    def __call__(self, context):
>        return myfancySource(context)
>
> - then, use myfancySourceBinder() as the source for your
> AutocompleteFieldWidget or  AutocompleteMultiFieldWidget
>
>
> Providing a search() method on an IVocabularyFactory object directly
> does not work, or at least I found it impossible using grok.implements

It would need to be on the vocabulary returned by the vocabulary factory, not on the factory. I think.
David


----------
David Glick
 Web Developer
 davidglick at groundwireconsulting.com
 206.286.1235x32

Groundwire Consulting is here.

http://groundwire.org/about/FAQ-gw-consulting




More information about the Product-Developers mailing list