def task_update(context, task_id, values, session=None):
 session = (session or get_session())
 with session.begin():
  task_info_values = _pop_task_info_values(values)
  task_ref = _task_get(context, task_id, session)
  _drop_protected_attrs(models.Task, values)
  values['updated_at'] = timeutils.utcnow()
  _task_update(context, task_ref, values, session)
  if task_info_values:
   _task_info_update(context, task_id, task_info_values, session)
 return task_get(context, task_id, session)

def task_update ( context , task_id , values , session = None ) : session = ( session or get_session ( ) ) with session . begin ( ) : task_info_values = _pop_task_info_values ( values ) task_ref = _task_get ( context , task_id , session ) _drop_protected_attrs ( models . Task , values ) values [ 'updated_at' ] = timeutils . utcnow ( ) _task_update ( context , task_ref , values , session ) if task_info_values : _task_info_update ( context , task_id , task_info_values , session ) return task_get ( context , task_id , session )
update a task object .