Good morning, I'am not shure but I have in my mind that Zope didn't like identifiers with the string id in it in ZSQL. Try worker_foo. Have a nice day. Lutz Steinborn On Wed, 4 Dec 2002 23:10:41 -0600 Skip Montanaro <skip@pobox.com> wrote:
I think I may have encountered this problem before and asked about it. If so, any solutions offered at that time escape me now. I have this ZSQL method (get_workorder):
<params>id worker_id end_date</params> select * from work_order <dtml-sqlgroup where> <dtml-sqltest name=id op=eq type=int optional> <dtml-and> <dtml-sqltest name=worker_id op=eq type=int optional> <dtml-and> <dtml-sqltest name=end_date op=ge type=string optional> </dtml-sqlgroup> ;
In a Python script I want to call it like so:
workorders = context.sql.get_workorder(worker_id=worker_id, end_date='2003-04-23')
that is, omit the presumably optional id parameter. However, when the Python script is run, the ZSQL method complains "Invalid integer value for id". I also tried these forms:
workorders = context.sql.get_workorder(**{'worker_id': worker_id, 'end_date': '2003-04-23'})
workorders = context.sql.get_workorder(**{'id': None, 'worker_id': worker_id, 'end_date': '2003-04-23'})
workorders = context.sql.get_workorder(id=None, worker_id=worker_id, end_date='2003-04-23')
without success. The first form gave the same error as above. The other two gave "object can't be converted to int".
How do I arrange things so I can call get_workorder without passing the id parameter?
Thx,
-- Skip Montanaro - skip@pobox.com http://www.mojam.com/ http://www.musi-cal.com/
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
-- Lutz Steinborn mailto:l.steinborn@4c-ag.de 4c AG Tel +49 6092 999592 Stefan-George-Ring 22-24 Fax +49 89 99341 399 81929 München http://www.4c-shopping.de