[Zope-DB] Problems using Z SQL Method result
Julián Muñoz
jmunoz@telefonica.net
Tue, 1 Oct 2002 19:17:37 +0000 (GMT)
I think this has been answered on the list by Dieter Maurer, take a look
at the archive.
In a product which calls sql methods, it calls it this way:
zsqlmethod(REQUEST)[0][0]
On Mon, 30 Sep 2002, Aparajita Fishman wrote:
> 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-DB mailing list
> Zope-DB@zope.org
> http://lists.zope.org/mailman/listinfo/zope-db
>
--
__o
_ \<_
(_)/(_)
Saludos de Julián
-.-
DVD-record Tools for linux
http://www.freesoftware.fsf.org/dvdrtools/