[Zope] ZSQL argument passing

Dieter Maurer dieter@handshake.de
Wed, 13 Mar 2002 22:47:12 +0100


Bryan C. Andregg writes:
 >   passwdGetUser(username=_.SecurityGetUser)
 > 
 >   passwdGetUser takes two optional arguments "username" and "userid",
 > ...
 > 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.
What Zope version do you use?

  In my Zope CVS (from end of January 2002), I still have:

    def __call__(self, REQUEST=None, __ick__=None, src__=0, test__=0, **kw):
	....
        if REQUEST is None:
            if kw: REQUEST=kw
            else:
                if hasattr(self, 'REQUEST'): REQUEST=self.REQUEST
                else: REQUEST={}

  This means, that you do not get arguments from "REQUEST" when
  you pass any keyword parameters (other than "__ick__", "src__", "test__"
  or "REQUEST").

  You never get arguments from the DTML namespace.

  But, you may still get arguments from acquisition (even when you pass
  keyword parameters).
  


Dieter