Using a ZSQL method from a Python script
Hi, I have made a ZSQL method, which adds a line to a table, much like the hire_employee method in 'the Zope book'. When I test it, an html form appears, I can enter all data, submit. I have also implemented the list_all_employees ZSQL method, and when I test it, I can see that in fact the data have landed in the table correctly. So far, so good.
From what I understand in the Zope book, I can then add new employees from a Python script like this:
------------------ context.hire_employee(42,'bob','uncle',50000.00) return "Done" ------------------ I get an internal server error 500, however, when I hit the test button. The hire_employee method and the Python script are in the same folder. What am I overlooking ? Thanks, Marc
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
participants (2)
-
Geir Bækholt -
Marc de Kamps