1 ## Script (Python) "doFormSearch"
3 ##title=Pre-process form variables, then return catalog query results.
7 skip_vars
= ['strCreator']
8 select_vars
= ( 'review_state'
12 date_vars
= ('created',
14 epoch
= DateTime("1970/01/01 00:00:00 GMT")
16 for k
, v
in vars.items():
19 if same_type( v
, [] ):
25 if v
== epoch
and vars.get(k
+'_usage') == 'range:min':
26 skip_vars
.append(k
+'_usage')
31 if form_vars
.has_key('portal_type') :
32 try : form_vars
['portal_type'].remove('Member Data')
33 except ValueError : pass
35 form_vars
['portal_type'] = context
.portal_types
.objectIds()
38 if form_vars
.has_key(k
) :
41 if vars.has_key('strCreator') :
42 form_vars
['listCreators'] = [ m
.getId() for m
in context
.portal_membership
.looseSearchMembers(vars['strCreator']) ]
44 return context
.portal_catalog( form_vars
)