[Zope] ZSQL method from python script

Jens Vagelpohl jens@zope.com
Mon, 30 Jul 2001 09:19:11 -0400


try passing the id argument more explicitly, like...

for result in context.updateState(id=id):
   ...

(assuming id is defined in your python script)

IMHO, for one's own sanity, it's always better to pass explicit named 
arguments to a method.

jens


On Monday, July 30, 2001, at 08:36 , Kerekes Lajos wrote:

> Kerekes Lajos wrote:
>
>> Hello!
>>
>> How can I call ZSQL method, from python script?
>> And how can I use the result set of the ZSQL method?
>>
>>    Thanks:
>>
>>     Lajos Kerekes
>>
>
> Since this email, I found some help in Zope Book, but still I have
> error.
> I have an "update" ZSQL method, the argument is 'id'.
> If I call it from python script in this way:
> ------------------
> for result in context.updateState(id):
> ------------------
>
> I get an error.
> -----------
> Error Type: Bad Request
> Error Value: ['id']
> .
> .
> .
> .
> File
> /usr/local/zope/Zope-2.3.3-linux2-x86/lib/python/Shared/DC/ZRDB/Aqueduct.
> py,
>
> line 150, in _argdata
> (Object: updateMLState)
> Bad Request: (see above)
> -----------
>
> What is the problem.
>
>     Thanks:
>
>             Lajos