Andreas Jung wrote:




--On 23. Dezember 2005 13:33:08 +0100 Fabio <[EMAIL PROTECTED]> wrote:

Hi!
in my zope application I call ZSQLMethods from python script. Is it
possible to set "connection id" property of a ZSQLMethod before call it?

How?
ZSQLMethod.propertyItems() return only ('title','')


perhaps

zsql_method.connection_id = '....' might to the job. See DA.py

-aj

Fabio,

This, I think, is something I found in ZopeLabs some time ago. ---------------------------------------------------------------------------------
objs = container.ZopeFind(container,
             obj_metatypes=['Z SQL Method'],
             search_sub=1)
# module:  pyPsycopgPropertyChanges
path_list = []
for path, method in objs:

  title = method.title
  conn_id = 'Psycopg_database_connection'
  args = method.arguments_src
  body = method.src

  method.manage_edit(title, conn_id, args, body,max_rows=5000)
  path_list.append(path)

header = "Fixed up the following methods - %s out of total sql count of %s"%(str(len(path_list)), str(len(objs)))
body="<br><br><ul><li>%s</li></ul>"%join(path_list, '</li><li>')
return header+body
---------------------------------------------------------------------------------
HTH,
David



_______________________________________________
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope-dev )

Reply via email to