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
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))
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
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))