Hi. * 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.
Actually it *is* intended to act this way, as this is what is meant with "acquisition by context". Btw: be careful with the optional attribute currently because it is broken for "None" Variables, but will work with empty strings. Greetings Christian -- 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'])