[prev in list] [next in list] [prev in thread] [next in thread] 

List:       zope-dev
Subject:    [Zope-dev] Problems using Z SQL Method result
From:       Aparajita Fishman <aparajita () aparajitaworld ! com>
Date:       2002-09-30 18:27:07
[Download RAW message or body]

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


_______________________________________________
Zope-Dev maillist  -  Zope-Dev@zope.org
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic