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

Paul Roeland paul at cleanclothes.org
Wed Jan 18 11:56:50 UTC 2012


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

Paul



More information about the Product-Developers mailing list