19 Mar
2002
19 Mar
'02
6:54 p.m.
[Phil Harris]
<dtml-in "objectValues(['some meta type'])"> <dtml-if "_.string.find(_['sequence-item'].getId(),'mydoc') ==0"> do something here </dtml-if> </dtml-in>
or preferably do it in a python script:
#script called mydoc_filter import string l=context.objectValues(['some_meta_type']) retval=[] for a in l: if string.find(a.getId(),'mydoc'): retval.append(a) return a
Remember that string.find returns -1, not 0, if it can't find the substring, so this test won't work if the value starts with the search string. The test needs to be if string.find(a.getId(),'mydoc')>-1: Cheers, Tom P