works like a charm. Thanks a ton.

On Feb 5, 9:15 pm, Anthony <[email protected]> wrote:
> On Sunday, February 5, 2012 2:04:13 PM UTC-5, Serbitar wrote:
>
> > I need to do something like this:
>
> > variable_field = 'val1'
> > x = 2
> > id = 1
>
> > db.define_table('a',
> >     Field('name', type = 'integer'),
> >     Field('val1', type = 'integer'),
> >     Field('val2', type = 'integer')
> > )
>
> > db(db.a.id==id).update(variable_field=x)
>
> try .update(**{variable_field: x})
>
> Anthony

Reply via email to