示例#1
0
文件: create.py 项目: afoone/ckan
def group_create_rest(context, data_dict):
    _check_access('group_create_rest', context, data_dict)
    dictized_group = model_save.group_api_to_dict(data_dict, context)
    dictized_after = _get_action('group_create')(context, dictized_group)
    group = context['group']
    group_dict = model_dictize.group_to_api(group, context)
    data_dict['id'] = group.id
    return group_dict
示例#2
0
def group_create_rest(context, data_dict):
    _check_access('group_create_rest', context, data_dict)
    dictized_group = model_save.group_api_to_dict(data_dict, context)
    dictized_after = _get_action('group_create')(context, dictized_group)
    group = context['group']
    group_dict = model_dictize.group_to_api(group, context)
    data_dict['id'] = group.id
    return group_dict
示例#3
0
文件: create.py 项目: hasadna/ckan
def group_create_rest(context, data_dict):
    _check_access("group_create_rest", context, data_dict)
    dictized_group = model_save.group_api_to_dict(data_dict, context)
    dictized_after = _get_action("group_create")(context, dictized_group)
    group = context["group"]
    group_dict = model_dictize.group_to_api(group, context)
    data_dict["id"] = group.id
    return group_dict
示例#4
0
文件: get.py 项目: allanglen/ckan
def group_show_rest(context, data_dict):

    check_access('group_show_rest',context, data_dict)

    logic.get_action('group_show')(context, data_dict)
    group = context['group']

    group_dict = model_dictize.group_to_api(group, context)

    return group_dict
示例#5
0
def group_show_rest(context, data_dict):

    check_access('group_show_rest', context, data_dict)

    logic.get_action('group_show')(context, data_dict)
    group = context['group']

    group_dict = model_dictize.group_to_api(group, context)

    return group_dict
示例#6
0
文件: update.py 项目: slmnhq/ckan
def group_update_rest(context, data_dict):

    model = context['model']
    id = data_dict["id"]
    group = model.Group.get(id)
    context["group"] = group
    context["allow_partial_update"] = True
    dictized_group = model_save.group_api_to_dict(data_dict, context)

    check_access('group_update_rest', context, dictized_group)

    dictized_after = get_action('group_update')(context, dictized_group)

    group = context['group']

    group_dict = model_dictize.group_to_api(group, context)

    return group_dict
示例#7
0
文件: update.py 项目: wade1990/ckan
def group_update_rest(context, data_dict):

    model = context['model']
    id = _get_or_bust(data_dict, "id")
    group = model.Group.get(id)
    context["group"] = group
    context["allow_partial_update"] = True
    dictized_group = model_save.group_api_to_dict(data_dict, context)

    _check_access('group_update_rest', context, dictized_group)

    dictized_after = _get_action('group_update')(context, dictized_group)

    group = context['group']

    group_dict = model_dictize.group_to_api(group, context)

    return group_dict
示例#8
0
文件: update.py 项目: agilee/ckan
def group_update_rest(context, data_dict):

    model = context["model"]
    id = _get_or_bust(data_dict, "id")
    group = model.Group.get(id)
    context["group"] = group
    context["allow_partial_update"] = True
    dictized_group = model_save.group_api_to_dict(data_dict, context)

    _check_access("group_update_rest", context, dictized_group)

    dictized_after = _get_action("group_update")(context, dictized_group)

    group = context["group"]

    group_dict = model_dictize.group_to_api(group, context)

    return group_dict