[Zope] Passing Arguments to ZSQL Method from Python Script

Meilicke, Scott scott.meilicke@intp.com
Tue, 24 Sep 2002 15:59:12 -0700


Would something like this work:

for user in context.Users.RegistrationInfo.objectValues("UserInfo"):
  context.sql_users_insert(first_name=user.first_name,
last_name=user.last_name, etc.)

if user is a dictionary, the zsql arguments would be
first_name=user[first_name], last_name=user[last_name], etc.

-Scott

-----Original Message-----
From: Chris A. Bruce [mailto:cbruce@sleeter.com]
Sent: Tuesday, September 24, 2002 3:36 PM
To: zope@zope.org
Subject: [Zope] Passing Arguments to ZSQL Method from Python Script


Is there an easy way to bind the attributes of an object into the parameters
of a zsql method?  I am trying to do something like this in Python Script:

for user in context.Users.RegistrationInfo.objectValues("UserInfo"):
  context.sql_users_insert(user)

The sql_users_insert takes a bunch of parameters and the "user" object above
is a ZClass with properties that have exact names as parameters for zsql
method.



Thanks for any help,


Chris Bruce
The information contained in this email message may be privileged and is
confidential information intended only for the use of the recipient or any
employee or agent responsible for delivering it to the intended recipient.
Any unauthorized use, distribution or copying of this information is
strictly prohibited and may be unlawful.  If you have received this
communication in error, please notify the sender immediately and destroy the
original message and all attachments from your electronic files.