[Grok-dev] registering vocabulary
Paolo Piersanti
paolo at micso.it
Thu Apr 14 05:47:30 EDT 2011
On 04/14/2011 11:03 AM, Sebastian Ware wrote:
> Have you removed your manual registration code? Could you paste a traceback?
>
yes sure, I also removed and reinstalled my app
what it looks like to me is that a GlobalUtility implementing
IVocabularyFactory doesn't register itself in the vocabulary registry
and zope.schema module does vocabulary lookup only in the vocabulary
registry, which results empty
however following your advice
> class WidgetTypeVocabulary(grok.GlobalUtility):
> grok.implements(IVocabularyFactory)
> grok.name('widget_type_vocabulary')
produce the following traceback
> Traceback (most recent call last):
> File "/home/gon/src/crm_campaign_env/crm_campaign/eggs/zope.publisher-3.12.6-py2.6.egg/zope/publisher/publish.py", line 132, in publish
> result = publication.callObject(request, obj)
> File "/home/gon/src/crm_campaign_env/crm_campaign/eggs/grokcore.view-2.5-py2.6.egg/grokcore/view/publication.py", line 56, in callObject
> return super(ZopePublicationSansProxy, self).callObject(request, ob)
> File "/home/gon/src/crm_campaign_env/crm_campaign/eggs/zope.app.publication-3.13.1-py2.6.egg/zope/app/publication/zopepublication.py", line 207, in callObject
> return mapply(ob, request.getPositionalArguments(), request)
> File "/home/gon/src/crm_campaign_env/crm_campaign/eggs/zope.publisher-3.12.6-py2.6.egg/zope/publisher/publish.py", line 107, in mapply
> return debug_call(obj, args)
> File "/home/gon/src/crm_campaign_env/crm_campaign/eggs/zope.publisher-3.12.6-py2.6.egg/zope/publisher/publish.py", line 113, in debug_call
> return obj(*args)
> File "/home/gon/src/crm_campaign_env/crm_campaign/eggs/grokcore.formlib-1.8-py2.6.egg/grokcore/formlib/components.py", line 90, in __call__
> self.update_form()
> File "/home/gon/src/crm_campaign_env/crm_campaign/eggs/grokcore.formlib-1.8-py2.6.egg/grokcore/formlib/components.py", line 62, in update_form
> super(GrokForm, self).update()
> File "/home/gon/src/crm_campaign_env/crm_campaign/eggs/zope.formlib-4.0.5-py2.6.egg/zope/formlib/form.py", line 758, in update
> self.setUpWidgets()
> File "/home/gon/src/crm_campaign_env/crm_campaign/eggs/zope.formlib-4.0.5-py2.6.egg/zope/formlib/form.py", line 833, in setUpWidgets
> adapters=self.adapters, ignore_request=ignore_request
> File "/home/gon/src/crm_campaign_env/crm_campaign/eggs/zope.formlib-4.0.5-py2.6.egg/zope/formlib/form.py", line 388, in setUpEditWidgets
> field = field.bind(adapter)
> File "/home/gon/src/crm_campaign_env/crm_campaign/eggs/zope.schema-3.7.1-py2.6.egg/zope/schema/_field.py", line 291, in bind
> clone.vocabulary = vr.get(object, self.vocabularyName)
> File "/home/gon/src/crm_campaign_env/crm_campaign/eggs/zope.schema-3.7.1-py2.6.egg/zope/schema/vocabulary.py", line 166, in get
> raise VocabularyRegistryError(name)
> VocabularyRegistryError: unknown vocabulary: u'widget_type_vocabulary'
Paolo Piersanti
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5998 bytes
Desc: S/MIME Cryptographic Signature
Url : http://mail.zope.org/pipermail/grok-dev/attachments/20110414/4826d77b/attachment.bin
More information about the Grok-dev
mailing list