[Grok-dev] re gistering vocabulary

Jeroen Michiel jmichiel at yahoo.com
Mon May 9 08:17:53 EDT 2011


Brilliant! adding 'zope.app.schema' did the trick!

Strange that a .app. package is still needed...

I tried with a clean 1.4 project, and had the same problem! Adding
'zope.app.schema' fixed it there, too...


Sebastian Ware wrote:
> 
> The only difference I see is that you name your vocab with a string
> 
>   grok.name('Time of Day')
> 
> and I use a unicode string
> 
>   grok.name(u'visibility')
> 
> oh, we have also added
> 
>   'zope.app.schema'
> 
> to install_requires in setup.py, I have a vague memory that this was
> related.
> 
> Mvh Sebastian
> 
> 9 maj 2011 kl. 11.03 skrev Jeroen Michiel:
> 
>> 
>> I have the exact same issue while trying to upgrade a v1.1 project to
>> v1.4
>> 
>> I create my vocabularies like this:
>> 
>> class TimeOfDayVocabulary(grok.GlobalUtility):
>>    grok.implements(IVocabularyFactory)
>>    grok.name('Time of Day')
>>    def __call__(self, context):
>>        return SimpleVocabulary.fromValues([u'Day', u'Night', u'Dusk',
>> u'Dawn'])
>> 
>> but each time a schema field tries to access them, I get a
>> VocabularyRegistryError: unknown vocabulary: u'Time of Day'
>> 
>> I'll try to revert to v1.3 and see if that makes any difference...
>> -- 
>> View this message in context:
>> http://old.nabble.com/registering-vocabulary-tp31388474p31575120.html
>> Sent from the Grok mailing list archive at Nabble.com.
>> 
>> _______________________________________________
>> Grok-dev mailing list
>> Grok-dev at zope.org
>> https://mail.zope.org/mailman/listinfo/grok-dev
>> 
> 
> _______________________________________________
> Grok-dev mailing list
> Grok-dev at zope.org
> https://mail.zope.org/mailman/listinfo/grok-dev
> 
> 

-- 
View this message in context: http://old.nabble.com/registering-vocabulary-tp31388474p31576240.html
Sent from the Grok mailing list archive at Nabble.com.



More information about the Grok-dev mailing list