Newbie help - test for data type

Bruno Desthuilliers onurb at xiludom.gro
Mon Jul 31 05:46:44 EDT 2006


Rob Wolfe wrote:
>> This is my function:
>> selecteddeptcodes = context.REQUEST.DEPTCODE
>> currentstatus = context.REQUEST.STATUS
>>
>> if currentstatus == 'pending':
>>  for dptcd in selecteddeptcodes:
>>    context.changetolive(DEPTCODE=dptcd)
>> if currentstatus == 'old':
>>  for dptcd in selecteddeptcodes:
>>    context.changetopending(DEPTCODE=dptcd)
>> return context.pub_dept_form(context, context.REQUEST, message='Updated
>> Status')
>>
>> The argument in question is selecteddeptcodes.
> 
> You can use isinstance or function like that:
> 

Zope has a better solution builtin.


-- 
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in 'onurb at xiludom.gro'.split('@')])"



More information about the Python-list mailing list