예제 #1
0
파일: views.py 프로젝트: icedstitch/crits
def samples_listing(request,option=None):
    """
    Generate Samples Listing template.

    :param request: Django request object (Required)
    :type request: :class:`django.http.HttpRequest`
    :param option: Whether or not we should generate a CSV (yes if option is "csv")
    :type option: str
    :returns: :class:`django.http.HttpResponse`
    """

    if option == "csv":
        return generate_sample_csv(request)
    return generate_sample_jtable(request, option)
예제 #2
0
def samples_listing(request, option=None):
    """
    Generate Samples Listing template.

    :param request: Django request object (Required)
    :type request: :class:`django.http.HttpRequest`
    :param option: Whether or not we should generate a CSV (yes if option is "csv")
    :type option: str
    :returns: :class:`django.http.HttpResponse`
    """

    if option == "csv":
        return generate_sample_csv(request)
    return generate_sample_jtable(request, option)
예제 #3
0
파일: views.py 프로젝트: armtash/crits
def samples_listing(request,option=None):
    """
    Generate Samples Listing template.

    :param request: Django request object (Required)
    :type request: :class:`django.http.HttpRequest`
    :param option: Whether or not we should generate a CSV (yes if option is "csv")
    :type option: str
    :returns: :class:`django.http.HttpResponse`
    """
    user = request.user

    if user.has_access_to(SampleACL.READ):
        if option == "csv":
            return generate_sample_csv(request)
        return generate_sample_jtable(request, option)
    else:
        return render(request, "error.html",
                                  {'error': 'User does not have permission to view Sample listing.'})
예제 #4
0
def samples_listing(request, option=None):
    """
    Generate Samples Listing template.

    :param request: Django request object (Required)
    :type request: :class:`django.http.HttpRequest`
    :param option: Whether or not we should generate a CSV (yes if option is "csv")
    :type option: str
    :returns: :class:`django.http.HttpResponse`
    """
    user = request.user

    if user.has_access_to(SampleACL.READ):
        if option == "csv":
            return generate_sample_csv(request)
        return generate_sample_jtable(request, option)
    else:
        return render(
            request, "error.html",
            {'error': 'User does not have permission to view Sample listing.'})