Is it possible, in Python using peewee + MySQL database, to use some variable as keyword in update function?
For example:
what = raw_input('What you want to change? name, surname, email ')
value = raw_input('What is the value?')
update = Users.update(what=value).where(Users.id == some_user_id)
update.execute()
If we have table like this:
class Users(BaseModel):
email = CharField(max_length=50, null=True)
name = CharField(max_length=50, null=True)
surname = CharField(max_length=50, null=True)
class Meta:
db_table = 'users'