def set_attr(self, username, char_id, attr, val):
    self.assert_valid('accounts', username, 'characters', char_id)
    self.get_character(username, char_id)[attr] = val
    self.save_db()
def set_attr(self, username, char_id, attr, val):
    self.assert_valid('accounts', username, 'characters', char_id)
    self.get_character(username, char_id)[attr] = val
    self.save_db()