def _map_to_rest_for_create_obj(obj): """See superclass.""" return dict( name=obj.name, email=obj.email, context=rest_convert.default_context() )
def _map_to_rest_for_create_obj(obj): """See superclass.""" return dict( person=rest_convert.to_basic_rest_obj(obj.person), role=rest_convert.to_basic_rest_obj(obj.role), context=rest_convert.default_context() )
def create_person(person): """Creates a person.""" return base_rest_service.create_obj( person, name=person.name, email=person.email, context=rest_convert.default_context())
def create_workflow(workflow): """Creates workflow via REST.""" return base_rest_service.create_obj( workflow, access_control_list=rest_convert.build_access_control_list( workflow, acr_mapping={"wf_members": "Workflow Member"}), title=workflow.title, context=rest_convert.default_context())
def _map_to_rest_for_create_obj(obj): """See superclass.""" return dict( person=rest_convert.to_basic_rest_obj(obj.person), role=rest_convert.to_basic_rest_obj(obj.role), context=(rest_convert.administrator_context() if obj.role.name == roles.ADMINISTRATOR else rest_convert.default_context()) )
def create_control(control): """Creates a control.""" return base_rest_service.create_obj( control, title=control.title, access_control_list=rest_convert.build_access_control_list(control), assertions=[rest_convert.to_basic_rest_obj(assertion) for assertion in control.assertions], context=rest_convert.default_context())
def _map_to_rest_for_create_obj(obj): """See superclass.""" return dict(access_control_list=rest_convert.build_access_control_list( obj, acr_mapping={"wf_members": "Workflow Member"}), title=obj.title, status=obj.state, repeat_every=obj.repeat_every, unit=obj.repeat_unit, recurrences=obj.recurrences_started, context=rest_convert.default_context())
def _map_to_rest_for_create_obj(obj): """See superclass.""" return dict( title=obj.title, access_control_list=rest_convert.build_access_control_list(obj), assertions=[ rest_convert.to_basic_rest_obj(assertion) for assertion in obj.assertions ], context=rest_convert.default_context())
def _map_to_rest_for_create_obj(obj): """See superclass.""" return dict( title=obj.title, access_control_list=rest_convert.build_access_control_list(obj), assertions=[assertion for assertion in obj.assertions], context=rest_convert.default_context(), review_status=obj.review_status, review_status_display_name=obj.review_status_display_name, external_id=obj.external_id, external_slug=obj.external_slug, )
def _map_to_rest_for_create_obj(obj): """See superclass.""" return dict(person=rest_convert.to_basic_rest_obj(obj.person), role=rest_convert.to_basic_rest_obj(obj.role), context=rest_convert.default_context())