コード例 #1
0
def download(request, document_file_id):
    assistant_mandate_document = mdl.assistant_document_file.find_by_id(document_file_id)
    document = document_file.find_by_id(assistant_mandate_document.document_file.id)
    filename = document.file_name
    response = HttpResponse(document.file, content_type=document.content_type)
    response['Content-Disposition'] = 'attachment; filename=%s' % filename
    return response
コード例 #2
0
def delete(request, document_file_id, url):
    assistant_mandate_document = mdl.assistant_document_file.find_by_id(
        document_file_id)
    document = document_file.find_by_id(
        assistant_mandate_document.document_file.id)
    assistant_mandate_document.delete()
    document.delete()
    return HttpResponseRedirect(reverse(url))
コード例 #3
0
def download(request, document_file_id):
    assistant_mandate_document = mdl.assistant_document_file.find_by_id(
        document_file_id)
    document = document_file.find_by_id(
        assistant_mandate_document.document_file.id)
    filename = document.file_name
    response = HttpResponse(document.file, content_type=document.content_type)
    response['Content-Disposition'] = 'attachment; filename=%s' % filename
    return response
コード例 #4
0
def delete(request, document_file_id, url):
    assistant_mandate_document = mdl.assistant_document_file.find_by_id(document_file_id)
    document = document_file.find_by_id(assistant_mandate_document.document_file.id)
    assistant_mandate_document.delete()
    document.delete()
    return HttpResponseRedirect(reverse(url))