This would solve your error.

class MyModel:
    def db_update(self, field_name, value):
        self.db(self.db.t_empire.id==self.record.id
).update(**{field_name:value})


However since you have the record in self.record. You can just do.

    def update(self, field_name, value):
        self.record.update_record(**{field_name:value})

The reason you have to do this is to pass the value of the variable 
fieldname as a keyword argument. I recommend you get to know at least a 
little bit of Python otherwise you will lose a lot of time with trial and 
error. It's worth the time investment to learn to use your tools right.

PS:. I do question the need your MyModel class is satisfying.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to