[Zope-dev] How to invoke a Z SQL method from python

Martijn Pieters mj@antraciet.nl
Fri, 03 Sep 1999 17:57:54 +0200


At 17:44 03/09/99 , Jim Penny wrote:
>Hi, I have to model some legacy forms.  They are tricky enough and
>the user's picky enough that I am not going to be able to use HTML
>as the source language.  So I want to drop to TeX.
>
>I have tucked the data for the form away in an external database.
>How do I execute a query against a ZSQL method from python.
>
>In particular, I have a ZSQL method sql_test, that has a single
>argument request_number.  Mucking about in python, I can see by
>program
>def test(self, request_number):
>         return request_number, dir(self.sql_test):
>that sql_test has structure:
>['__ac_local_roles__', '_arg', '_col', '_v_brain', '_v_cache',
>'arguments_src', 'connection_id', 'id', 'src', 'template', 'title']
>
>But, I don't see anything in sight that actually causes the query
>to be invoked.
>
>Could someone give an example, or point me to the general area of the
>source code in which a ZSQL method is invoked?

Just do self.sql_test(request_number=xxx)

--
Martijn Pieters, Web Developer
| Antraciet http://www.antraciet.nl
| Tel: +31-35-7502100 Fax: +31-35-7502111
| mailto:mj@antraciet.nl http://www.antraciet.nl/~mj
| PGP: http://wwwkeys.nl.pgp.net:11371/pks/lookup?op=get&search=0xA8A32149
------------------------------------------