示例#1
0
文件: ajax.py 项目: dmacmillan/Kive
    def download(self, request, pk=None):
        """
        Handles downloading of the Dataset.
        """
        dataset = self.get_object()

        return build_download_response(dataset.dataset_file)
示例#2
0
文件: ajax.py 项目: cfe-lab/Kive
    def download(self, request, pk=None):
        """
        Handles downloading of the Dataset.
        """
        dataset = self.get_object()

        return build_download_response(dataset.dataset_file)
示例#3
0
文件: views.py 项目: cfe-lab/Kive
def stderr_download(request, methodoutput_id):
    """
    Display the standard output associated with the method output in the browser.
    """
    try:
        methodoutput = MethodOutput.objects.get(pk=methodoutput_id)
    except Dataset.DoesNotExist:
        raise Http404("Method output {} cannot be accessed".format(methodoutput_id))

    return build_download_response(methodoutput.error_log)
示例#4
0
文件: views.py 项目: cfe-lab/Kive
def dataset_download(request, dataset_id):
    """
    Retrieve the file associated with the dataset for client download.
    """
    try:
        dataset = librarian.models.Dataset.filter_by_user(request.user).get(pk=dataset_id)
    except ObjectDoesNotExist:
        raise Http404("ID {} cannot be accessed".format(dataset_id))

    return build_download_response(dataset.dataset_file)
示例#5
0
def stderr_download(request, methodoutput_id):
    """
    Display the standard output associated with the method output in the browser.
    """
    try:
        methodoutput = MethodOutput.objects.get(pk=methodoutput_id)
    except Dataset.DoesNotExist:
        raise Http404(
            "Method output {} cannot be accessed".format(methodoutput_id))

    return build_download_response(methodoutput.error_log)
示例#6
0
文件: ajax.py 项目: cfe-lab/Kive
    def download(self, request, pk=None):
        """
        Handles downloading of the Dataset.
        """
        dataset = self.get_object()
        dataset_handle = dataset.get_open_file_handle()

        if dataset_handle is not None:
            return build_download_response(dataset_handle)
        else:
            raise APIException(f"Couldn't find dataset file for {dataset.name}")
示例#7
0
def dataset_download(request, dataset_id):
    """
    Retrieve the file associated with the dataset for client download.
    """
    try:
        dataset = librarian.models.Dataset.filter_by_user(
            request.user).get(pk=dataset_id)
    except ObjectDoesNotExist:
        raise Http404("ID {} cannot be accessed".format(dataset_id))

    return build_download_response(dataset.dataset_file)
示例#8
0
文件: ajax.py 项目: dmacmillan/Kive
    def download(self, request, pk=None):
        """
        Download the file pointed to by this CodeResourceRevision.
        """
        accessible_revisions = CodeResourceRevision.filter_by_user(request.user)
        if not accessible_revisions.filter(pk=pk).exists():
            return Response(None, status=status.HTTP_404_NOT_FOUND)

        revision = self.get_object()
        if not revision.content_file:
            return Response({"errors": "This CodeResourceRevision has no content file."},
                            status=status.HTTP_403_FORBIDDEN)

        return build_download_response(revision.content_file)
示例#9
0
文件: ajax.py 项目: cfe-lab/Kive
 def download(self, request, pk=None):
     container = self.get_object()
     return build_download_response(container.file)
示例#10
0
文件: ajax.py 项目: cfe-lab/Kive
 def download(self, request, pk=None):
     container = self.get_object()
     return build_download_response(container.file)