[Zope] how call a ZSQL method from a product instance+work w the results

hans hans@beehive.de
Tue, 12 Mar 2002 17:51:19 +0000


inside my product i have a method like

 def manage_draw_PI(self, REQUEST=None):
  """draw:
      get the x- and y-coords from database
  """
  self.sql_method = \
  sql_method = self.aq_parent['sql_query']     # aquired from container

  self.sql_result = sql_method.__call__(query=self.sql_query) # query =
'select * from PI'
  self._p_changed = 1
  if REQUEST is not None:
   management_view='Edit' # tell zope to hilight mgnt tab
   return self.manage_edit_PraxisIndex_Form(self)
  else:
   return

sql_query is a sql_method for some GadFly.DA
if the line w __call__ is commented out, it works (without function).
if not, i get

Zope Error
Zope has encountered an error while publishing this resource.
Error Type: cPickle.PicklingError
Error Value: Cannot pickle objects.
(a look at source shows: <extension class
Acquisition.ImplicitAcquirerWrapper at 00EC5110>)

Traceback (innermost last):
  File C:\PROGRA~1\Zope232\lib\python\ZPublisher\Publish.py, line 223,
in publish_module
  File C:\PROGRA~1\Zope232\lib\python\ZPublisher\Publish.py, line 187,
in publish
  File C:\PROGRA~1\Zope232\lib\python\Zope\__init__.py, line 221, in
zpublisher_exception_hook
    (Object: rki)
  File C:\PROGRA~1\Zope232\lib\python\ZPublisher\Publish.py, line 175,
in publish
  File C:\PROGRA~1\Zope232\lib\python\Zope\__init__.py, line 235, in
commit
  File C:\PROGRA~1\Zope232\lib\python\ZODB\Transaction.py, line 300, in
commit
  File C:\PROGRA~1\Zope232\lib\python\ZODB\Connection.py, line 375, in
commit
    (Info: (('Products.PraxIndex.RKI', 'PraxisIndex'),
'\000\000\000\000\000\000\027N', ''))
cPickle.PicklingError: (see above)

carefully reading Shared/DC/ZRDB revealed nothing
(hey, what is a zbrain and what is it good for?)

-------------------------------------------------------------
Who's got only a hammer sees the world as a nail
hans augustin  (software developer)           hans@beehive.de
beehive elektronische medien GmbH       http://www.beehive.de
phone: +49 30 847-82 0                  fax: +49 30 847-82 299