Пример #1
0
def statistic_delete(oauth_request, template_id, statistic_id, extension):

    Statistic_ = Statistic()
    Statistic_.current_user = oauth_request.user
    deleted_statistic = Statistic_.statistic_delete(template_id, statistic_id)

    if type(deleted_statistic) is tuple:
        return deleted_statistic

    return status_.status_204(), 204
Пример #2
0
def statistic_update(oauth_request, template_id, statistic_id, extension):

    Statistic_ = Statistic()
    Statistic_.current_user = oauth_request.user
    updated_statistic = Statistic_.statistic_update(template_id, statistic_id, request)

    if type(updated_statistic) is tuple:
        return updated_statistic

    arguments = {"the_content": updated_statistic, "extension": extension, "code": 200}

    return Statistic_.endpoint_response(**arguments)
Пример #3
0
def statistic_post(oauth_request, template_id, extension):

    Statistic_ = Statistic()
    Statistic_.current_user = oauth_request.user
    new_statistic = Statistic_.statistic_create(template_id, request)

    if type(new_statistic) is tuple:
        return new_statistic

    arguments = {"the_content": new_statistic, "extension": extension}

    return Statistic_.endpoint_response(**arguments)
Пример #4
0
def statistic_get(oauth_request, template_id, statistic_id, extension):

    Statistic_ = Statistic()
    Statistic_.current_user = oauth_request.user
    statistic_get = Statistic_.statistic_get(template_id, statistic_id)

    if type(statistic_get) is tuple:
        return statistic_get

    arguments = {"the_content": statistic_get, "extension": extension}

    return Statistic_.endpoint_response(**arguments)