[Grok-dev] using **kw in a View's Update?

Brandon Craig Rhodes brandon at rhodesmill.org
Tue Feb 3 07:07:03 EST 2009


Jeroen Michiel <jmichiel at yahoo.com> writes:

> Though it still seems strange to me that is it doesn't work, as in the
> documentation the function is defined as
> update(**kw)¶
>
> and doing 
>     def update(self, foo=None, bar=None)
>         self.foo = foo
>         self.bar=bar
> does work! 

That's because it auto-detects which keyword arguments your function
requires, and sends only those. :-)

-- 
Brandon Craig Rhodes   brandon at rhodesmill.org   http://rhodesmill.org/brandon


More information about the Grok-dev mailing list