def task_status_update(context, data_dict):
 model = context['model']
 session = model.meta.create_local_session()
 context['session'] = session
 user = context['user']
 id = data_dict.get('id')
 schema = (context.get('schema') or schema_.default_task_status_schema())
 if id:
  task_status = model.TaskStatus.get(id)
  context['task_status'] = task_status
  if (task_status is None):
   raise NotFound(_('TaskStatus was not found.'))
 _check_access('task_status_update', context, data_dict)
 (data, errors) = _validate(data_dict, schema, context)
 if errors:
  session.rollback()
  raise ValidationError(errors)
 task_status = model_save.task_status_dict_save(data, context)
 session.commit()
 session.close()
 return model_dictize.task_status_dictize(task_status, context)

def task_status_update ( context , data_dict ) : model = context [ 'model' ] session = model . meta . create_local_session ( ) context [ 'session' ] = session user = context [ 'user' ] id = data_dict . get ( 'id' ) schema = ( context . get ( 'schema' ) or schema_ . default_task_status_schema ( ) ) if id : task_status = model . TaskStatus . get ( id ) context [ 'task_status' ] = task_status if ( task_status is None ) : raise NotFound ( _ ( 'TaskStatus was not found.' ) ) _check_access ( 'task_status_update' , context , data_dict ) ( data , errors ) = _validate ( data_dict , schema , context ) if errors : session . rollback ( ) raise ValidationError ( errors ) task_status = model_save . task_status_dict_save ( data , context ) session . commit ( ) session . close ( ) return model_dictize . task_status_dictize ( task_status , context )
update a task status .