code: def update(self, model):
          
  
          signals.pre_update.send(model.__class__, model=model)
          signals.pre_save.send(model.__class__, model=model)
  
          param = self.to_pg(model)
          param['rid_value'] = param[model.rid_field]
  
          query = """
                  UPDATE {table}
                  SET ({dirty_cols}) = ({dirty_vals})
                  WHERE {rid_field} = %(rid_value)s
                  RETURNING {cols};
                  """
  
          query = query.format(
              cols=self.field_cols(model),
              dirty_cols=self.dirty_cols(model),
              dirty_vals=self.dirty_vals(model),
              rid_field=model.rid_field,
              table=model.rtype,
          )
  
          result = self.query(query, param=param)
  
          signals.post_update.send(model.__class__, model=model)
          signals.post_save.send(model.__class__, model=model)
  
          return model.merge(result[0], clean=True)
docs: Given a model object instance update it