[Zope] Using a ZSQL method from a Python script

Geir Bækholt Geir Bækholt
Tue, 25 Mar 2003 14:50:47 +0100


On  Tue, 25 Mar 2003 14:19:14 +0100 GMT (..14:19 where i live(GMT+1) )
Marc de Kamps asked the Zope mailinglist about the following:

MdK> I have made a ZSQL method, which
MdK> adds a line to a table, much like
MdK> the hire_employee method in 'the Zope book'.
MdK> When I test it, an html form appears, I can
MdK> enter all data, submit.
...
MdK> From what I understand in the Zope book,
MdK> I can then add new employees from a Python
MdK> script like this:

MdK> context.hire_employee(42,'bob','uncle',50000.00)
MdK> return "Done"

parameters have to be passed explicitly to SQL methods :
context.hire_employee(eid=42,name='bob',relation='uncle',salary=50000.00)
return " that is better :) "

--
Geir Bækholt