示例#1
0
文件: views.py 项目: mattrco/microweb
def attachments(request, comment_id):
    """
    Retrieve a comment's attachments.
    """

    try:
        response = Attachment.source(request.get_host(), type=Comment.api_path_fragment, id=comment_id,
            access_token=request.access_token)
    except APIException as exc:
        return respond_with_error(request, exc)
    return HttpResponse(response, content_type='application/json')
示例#2
0
def attachments(request, comment_id):
    """
    Retrieve a comment's attachments.
    """

    try:
        response = Attachment.source(request.get_host(),
                                     type=Comment.api_path_fragment,
                                     id=comment_id,
                                     access_token=request.access_token)
    except APIException as exc:
        return respond_with_error(request, exc)
    return HttpResponse(response, content_type='application/json')