2011/10/12 Dragan Espenschied <[email protected]>:
> Am 12.10.2011 12:59, schrieb Anand Chitipothu:
>> 2011/10/12 Dragan Espenschied <[email protected]>:
>>> Hello,
>>>
>>> from the documentation page for db.update:
>>>
>>>        See the select for more information on arguments
>>>        that are accepted by update.
>>>
>>> On the page for db.select, there is stated that as an optional 2nd 
>>> parameter one
>>> can pass a dictionary for secure escaping in the SQL generation.
>>>
>>> But db.update does not support it.
>>>
>>> Can I suggest to harmonize the passing of this dictionary to all the db 
>>> methods?
>>> Is there in general a reason why the methods handles it differently? I 
>>> think it
>>> is needed in all the methods. Or am I doing something wrong?
>>
>> You can pass vars={..} to db.update as well.
>
> Aha!
>
> So is this style not okay, though it works?
>
>        db.select('table', {'lol':'wut'}, where='lol = $lol')

Always pass vars as keyword argument. I always keep it at the end for
better readability.

db.select('table', where='lol = $lol', vars={'lol':'wut'})

Anand

-- 
You received this message because you are subscribed to the Google Groups 
"web.py" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/webpy?hl=en.

Reply via email to