On 23 Oct 2007, at 07:06, Erwin Ambrosch|XHOSTPLUS wrote:
>
> Hi,
>
> I'm using web.query() for the following, but I want to use
> web.insert().
> Can one tell me how to do this.
>
> data = {'name':'Erwin','age':38}
> web.query("INSERT INTO my_table (name, age) VALUES ($name, $age)",
> vars=data)
>
> I found no way to use web.insert() using vars=data.
Try **data, to pass that dictionary as the keyword arguments.
If I remember correctly:
key = web.insert('my_table', **data)
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---