Back to index

plone3  3.1.7
unicodeTestIn.py
Go to the documentation of this file.
00001 ## Script (Python) "unicodeTestIn"
00002 ##title=Test if a unicode string is in a unicode list
00003 ##bind container=container
00004 ##bind context=context
00005 ##bind namespace=
00006 ##bind script=script
00007 ##bind subpath=traverse_subpath
00008 ##parameters=value, vocab
00009 
00010 if vocab is None or len(vocab) == 0:
00011     return 0
00012 
00013 value = context.unicodeEncode(value)
00014 vocab = [context.unicodeEncode(v) for v in vocab]
00015 
00016 return value in vocab