[Zope] ZSQL argument passing

Christian Theune ct@gocept.com
Wed, 13 Mar 2002 21:39:30 +0100


And btw: i had some problems with ppl not reading my mail because signing it, you
should probably turn it off when posting to the list ... using a good MUA will make
that easy.

* Bryan C. Andregg <bryan.andregg@duke.edu> [020313 14:41]:
> While iterating over the results of a ZSQL method, which includes a fieldname
> "userid" I call another ZSQL method like so,
> 
>   passwdGetUser(username=_.SecurityGetUser)
> 
>   passwdGetUser takes two optional arguments "username" and "userid",
> 
>     select * from passwd <dtml-sqlgroup where> <dtml-sqltest userid type=int
>     optional> <dtml-and> <dtml-sqltest username type=nb optional>
>     </dtml-sqlgroup>
> 
> When called like above,
> 
>   passwdGetUser(username=_.SecurityGetUser)
> 
> I found that some times this wouldn't return anything. Investigation turned
> up that since "userid" is set in the outer iteration it gets passed to
> passwdGetUser even though it's not explicitly in the statement. I solve this
> problem by calling,
> 
>   passwdGetUser(username=_.SecurityGetUser, userid='')
> 
> To me, this is non-obvious and I'm wondering why this is happening, and if
> it's meant to.  -- Bryan C. Andregg		Duke University Medical Center
> Programmer			Dept. of Anesthesiology e <bryan.andregg@duke.edu> p +1
> 919 684 6201


-- 
Christian Theune - ct@gocept.com
gocept gmbh & co.kg - schalaunische strasse 6 - 06366 koethen/anhalt
tel.+49 3496 3099112 - fax.+49 3496 3099118 mob. - 0178 48 33 981

reduce(lambda x,y:x+y,[chr(ord(x)^42) for x in 'zS^BED\nX_FOY\x0b'])