You have to unpack the dict

db.table.insert(**dict)

dbset.update(**dict)

In python ** unpack dict key/value

Also if you want to filter the valid fields you can use the

db.table.insert(**db.table._filter_fields(dict))

On Tue, Apr 3, 2012 at 12:26 PM, Richard <ml.richard.vez...@gmail.com>wrote:

> Hello,
>
> I would like to update some field with the out put of a web2py query that
> I can transform as dict like this :
>
> db(...).select(db.table1.field1, db.table1.field2).first().as_dict()
>
> Then I would do that :
>
> db(...).update(db(...).select(db.table1.field1,
> db.table1.field2).first().as_dict())
>
> Mistake buzzer trigger!!! : update() takes exactly 1 argument (2 given)
>
> Under 1.99.4
>
> Why I can't pass a dict to the update function?
>
> Thanks
>
> Richard
>



-- 

Bruno Rocha
[http://rochacbruno.com.br]

Reply via email to