[ZPatterns] simple python script <-> skinscript interaction question

Rob Miller [email protected]
Sat, 28 Dec 2002 13:13:55 -0800


On Saturday, December 28, 2002, at 01:09 PM, Steve Spicklemire wrote:

> How about using a dictionary and doing:
>
> WITH py_methodname COMPUTE attr4=RESULT.get('foo'), 
> attr5=RESULT.get('bar')
>
> or similar? Or did you want to avoid referring to RESULT directly?

no, this will do... i knew it would be simple... thanks!

-r


>
> On Friday, December 27, 2002, at 06:23  PM, Rob Miller wrote:
>
>> Hi there,
>>
>> I'm currently a bit stumped by what I think is a very simple issue.  
>> I'm populating the attributes of a DataSkin object using both ZSQL 
>> Methods and Python Scripts that are in the corresponding Rack.  I can 
>> populate several attibutes at one time by using a ZSQL Method and the 
>> "WITH QUERY sql_methodname COMPUTE attr1, attr2, attr3" SkinScript 
>> idiom.  I can also populate a single attribute by using a Python 
>> Script and the "WITH py_methodname COMPUTE attr4=RESULT" SkinScript 
>> idiom.
>>
>> What I can't do, however, is figure out how to return several 
>> attributes at once using Python Scripts.  I've tried returning 
>> dictionaries, I've tried return namespaces (i.e. using Zope's 
>> "_(dictionary)" syntax), I've tried every combination conceivable of 
>> using (or not) the "QUERY" modifier in the SkinScript statement, but 
>> I can't seem to get it to work, nor can I find anything enlightening 
>> in docs or mailing list archive.
>>
>> Can someone tell me what I need to do to get "WITH py_methodname 
>> COMPUTER attr1, attr2, attr3" to work?
>>
>> thanks!
>>
>> -r
>>
>> _______________________________________________
>> ZPatterns mailing list
>> [email protected]
>> http://www.eby-sarna.com/mailman/listinfo/zpatterns
>