Skip to content

Index

hypha.apply.funds.views

GroupingApplicationsListView

Bases: TemplateView

Template view for grouped submissions

template_name class-attribute instance-attribute

template_name = 'funds/grouped_application_list.html'

RoundListView

Bases: SingleTableMixin, FilterView

template_name class-attribute instance-attribute

template_name = 'funds/rounds.html'

table_class class-attribute instance-attribute

table_class = RoundsTable

filterset_class class-attribute instance-attribute

filterset_class = RoundsFilter

get_queryset

get_queryset()
Source code in hypha/apply/funds/views/__init__.py
def get_queryset(self):
    return RoundsAndLabs.objects.with_progress()

SubmissionPrivateMediaView

Bases: UserPassesTestMixin, PrivateMediaView

storage class-attribute instance-attribute

storage = PrivateStorage()

raise_exception class-attribute instance-attribute

raise_exception = True

get

get(*args, **kwargs)
Source code in hypha/apply/utils/storage.py
def get(self, *args, **kwargs):
    file_to_serve = self.get_media(*args, **kwargs)
    return FileResponse(file_to_serve)

dispatch

dispatch(*args, **kwargs)
Source code in hypha/apply/funds/views/__init__.py
def dispatch(self, *args, **kwargs):
    submission_pk = self.kwargs["pk"]
    self.submission = get_object_or_404(ApplicationSubmission, pk=submission_pk)
    return super().dispatch(*args, **kwargs)

get_media

get_media(*args, **kwargs)
Source code in hypha/apply/funds/views/__init__.py
def get_media(self, *args, **kwargs):
    field_id = kwargs["field_id"]
    file_name = kwargs["file_name"]
    path_to_file = generate_private_file_path(
        self.submission.pk, field_id, file_name
    )
    return self.storage.open(path_to_file)

test_func

test_func()
Source code in hypha/apply/funds/views/__init__.py
def test_func(self):
    permission, _ = has_permission(
        "submission_view", self.request.user, self.submission
    )
    return permission

submission_success

submission_success(request, pk)
Source code in hypha/apply/funds/views/__init__.py
def submission_success(request, pk):
    submission = get_object_or_404(ApplicationSubmission, pk=pk)
    return render(
        request,
        "funds/submission-success.html",
        {
            "form_submission": submission,
        },
    )