Am Montag, den 27.03.2006, 11:52 +0900 schrieb [EMAIL PROTECTED]: 
> Hi, 
> I got a ploblem with SimpleVocabulary/SimpleTerm.
> Here is the situation of that.
> (1) I used Zope3.2 on Windows XP.
> (2) I made :
>        a vocabulary, and
>        a Choice field with the vocabulary, and
>        a schema contains the field, and
>        an add-form using the schema.
> (3) the vocabulary was made using SimpleVocabulary.fromValues().
>     with values which are all unicode strings(japanese).


Vocabularies hav three levels:
value: which is stored in ZODB
token: which is used as value attribute of the option tag in HTML-Page.
It must be convertable to str with ASCII encoding because when the
conversion is done the encoding of the page is not yet known. (Correct
me if I'm wrong here)
title: which is dislpayed to the user as the contents of the option tag

SimpleVocabulary.fromValues uses the values as value, token and title,
so it is only useable with ASCII values.

So you have to do it like this way:
SimpleVocabulary(SimpleTerm(<value>, <token>, <title>), ...)

token might be the uid of value, if it is an object which is stored in


Zope3-users mailing list

Reply via email to