[Zope-dev] Problems using Z SQL Method result

Aparajita Fishman aparajita@aparajitaworld.com
Mon, 30 Sep 2002 14:27:07 -0400


Help!!

I am trying to write a product that will encapsulate a SQL query and 
render the results in a table. But I'm having a terrible time getting 
at the data in the SQL results.

This works in DTML:

<dtml-in expr="sql_method()" prefix="row">
   <p><dtml-var expr="row_item['name']"></p>
</dtml-in>

But if I try this in my product's code directly:

result = apply(sql_method, (), {})

for i in result:
    foo = i['name']

I get the following exception:

Error Type: UnpickleableError
Error Value: Cannot pickle <extension class 
Acquisition.ImplicitAcquirerWrapper at 5e8140> objects

Traceback (innermost last):
   File /Users/zope/zope2/lib/python/ZPublisher/Publish.py, line 150, in 
publish_module
   File /Users/zope/zope2/lib/python/ZPublisher/Publish.py, line 114, in 
publish
   File /Users/zope/zope2/lib/python/Zope/__init__.py, line 159, in 
zpublisher_exception_hook
     (Object: dv)
   File /Users/zope/zope2/lib/python/ZPublisher/Publish.py, line 102, in 
publish
   File /Users/zope/zope2/lib/python/Zope/__init__.py, line 173, in 
commit
   File /Users/zope/zope2/lib/python/ZODB/Transaction.py, line 234, in 
commit
   File /Users/zope/zope2/lib/python/ZODB/Connection.py, line 346, in 
commit
     (Info: (('Products.DataView.DataView', 'DataView'), 
'\x00\x00\x00\x00\x00\x00>A', ''))
UnpickleableError: (see above)

Alternately, if I try to return the result from my product to DTML and 
then use that in a <dtml-in>, I get the same error.

What is going wrong?
	
    Aparajita
    Victory-Heart Productions
    aparajita@aparajitaworld.com
    www.aparajitaworld.com