Skip to content

Views

hypha.apply.funds.views

User module-attribute

User = get_user_model()

SubmissionStatsMixin

get_context_data

get_context_data(**kwargs)
Source code in hypha/apply/funds/views.py
def get_context_data(self, **kwargs):
    submissions = ApplicationSubmission.objects.exclude_draft()
    submission_undetermined_count = submissions.undetermined().count()
    review_my_count = submissions.reviewed_by(self.request.user).count()

    submission_value = submissions.current().value()
    submission_sum = intcomma(submission_value.get("value__sum"))
    submission_count = submission_value.get("value__count")

    submission_accepted = submissions.current_accepted()
    submission_accepted_value = submission_accepted.value()
    submission_accepted_sum = intcomma(submission_accepted_value.get("value__sum"))
    submission_accepted_count = submission_accepted.count()

    reviews = Review.objects.submitted()
    review_count = reviews.count()
    review_my_score = reviews.by_user(self.request.user).score()

    return super().get_context_data(
        submission_undetermined_count=submission_undetermined_count,
        review_my_count=review_my_count,
        submission_sum=submission_sum,
        submission_count=submission_count,
        submission_accepted_count=submission_accepted_count,
        submission_accepted_sum=submission_accepted_sum,
        review_count=review_count,
        review_my_score=review_my_score,
        **kwargs,
    )

BaseAdminSubmissionsTable

Bases: SingleTableMixin, FilterView

table_class class-attribute instance-attribute

table_class = AdminSubmissionsTable

filterset_class class-attribute instance-attribute

filterset_class = SubmissionFilterAndSearch

filter_action class-attribute instance-attribute

filter_action = ''

search_action class-attribute instance-attribute

search_action = ''

paginator_class class-attribute instance-attribute

paginator_class = LazyPaginator

table_pagination class-attribute instance-attribute

table_pagination = {'per_page': 25}

excluded_fields class-attribute instance-attribute

excluded_fields = SUBMISSIONS_TABLE_EXCLUDED_FIELDS

excluded property

excluded

get_table_kwargs

get_table_kwargs(**kwargs)
Source code in hypha/apply/funds/views.py
def get_table_kwargs(self, **kwargs):
    return {**self.excluded, **kwargs}

get_filterset_kwargs

get_filterset_kwargs(filterset_class, **kwargs)
Source code in hypha/apply/funds/views.py
def get_filterset_kwargs(self, filterset_class, **kwargs):
    new_kwargs = super().get_filterset_kwargs(filterset_class)
    new_kwargs.update(self.excluded)
    new_kwargs.update(kwargs)
    return new_kwargs

get_queryset

get_queryset()
Source code in hypha/apply/funds/views.py
def get_queryset(self):
    submissions = self.filterset_class._meta.model.objects.current().for_table(
        self.request.user
    )

    if not can_access_drafts(self.request.user):
        submissions = submissions.exclude_draft()

    return submissions

get_context_data

get_context_data(**kwargs)
Source code in hypha/apply/funds/views.py
def get_context_data(self, **kwargs):
    search_term = self.request.GET.get("query")

    return super().get_context_data(
        search_term=search_term,
        search_action=self.search_action,
        filter_action=self.filter_action,
        **kwargs,
    )

BatchUpdateLeadView

Bases: DelegatedViewMixin, FormView

form_class class-attribute instance-attribute

context_name class-attribute instance-attribute

context_name = 'batch_lead_form'

setup

setup(request, *args, **kwargs)

Initialize attributes shared by all view methods.

Source code in hypha/apply/utils/views.py
def setup(self, request, *args, **kwargs):
    """Initialize attributes shared by all view methods."""
    self.request = request
    self.args = args
    self.kwargs = kwargs

get_object

get_object()
Source code in hypha/apply/utils/views.py
def get_object(self):
    # Make sure the form instance, bound at the parent class level,  is the same as the
    # value we work with on the class.
    # If we don't have self.object, bind the parent instance to it. This value will then
    # be used by the form. Any further calls to get_object will get a new instance of the object
    if not hasattr(self, "object"):
        parent_object = self.get_parent_object()
        if isinstance(parent_object, self.model):
            return parent_object

    return super().get_object()

get_template_names

get_template_names()
Source code in hypha/apply/utils/views.py
def get_template_names(self):
    return self.kwargs["template_names"]

get_form_name

get_form_name()
Source code in hypha/apply/utils/views.py
def get_form_name(self):
    return self.context_name

get_form_kwargs

get_form_kwargs()
Source code in hypha/apply/utils/views.py
def get_form_kwargs(self):
    form_kwargs = super().get_form_kwargs()
    form_kwargs["user"] = self.request.user
    form_kwargs.update(**self.get_parent_kwargs())
    return form_kwargs

get_parent_kwargs

get_parent_kwargs()
Source code in hypha/apply/utils/views.py
def get_parent_kwargs(self):
    try:
        return self.parent.get_form_kwargs()
    except AttributeError:
        return self.kwargs["parent"].get_form_kwargs()

get_parent_object

get_parent_object()
Source code in hypha/apply/utils/views.py
def get_parent_object(self):
    return self.get_parent_kwargs()["instance"]

get_form

get_form(*args, **kwargs)
Source code in hypha/apply/utils/views.py
def get_form(self, *args, **kwargs):
    form = super().get_form(*args, **kwargs)
    form.name = self.get_form_name()
    return form

get_context_data

get_context_data(**kwargs)
Source code in hypha/apply/utils/views.py
def get_context_data(self, **kwargs):
    # Use the previous context but override the validated form
    form = kwargs.pop("form")
    kwargs.update(self.kwargs["context"])
    kwargs.update(**{self.context_name: form})
    return super().get_context_data(**kwargs)

is_model_form classmethod

is_model_form()
Source code in hypha/apply/utils/views.py
@classmethod
def is_model_form(cls):
    return issubclass(cls.form_class, ModelForm)

contribute_form

contribute_form(parent)
Source code in hypha/apply/utils/views.py
def contribute_form(self, parent):
    self.parent = parent

    # We do not want to bind any forms generated this way
    # pretend we are doing a get request to avoid passing data to forms
    old_method = None
    if self.request.method in ("POST", "PUT"):
        old_method = self.request.method
        self.request.method = "GET"

    form = self.get_form()

    if old_method:
        self.request.method = old_method
    return self.context_name, form

get_success_url

get_success_url()
Source code in hypha/apply/utils/views.py
def get_success_url(self):
    query = self.request.GET.urlencode()
    if query:
        query = "?" + query
    return self.request.path + query

form_valid

form_valid(form)
Source code in hypha/apply/funds/views.py
def form_valid(self, form):
    new_lead = form.cleaned_data["lead"]
    submissions = form.cleaned_data["submissions"]
    services.bulk_update_lead(
        submissions=submissions,
        user=self.request.user,
        lead=new_lead,
        request=self.request,
    )
    return super().form_valid(form)

form_invalid

form_invalid(form)
Source code in hypha/apply/funds/views.py
def form_invalid(self, form):
    messages.error(
        self.request,
        mark_safe(_("Sorry something went wrong") + form.errors.as_ul()),
    )
    return super().form_invalid(form)

BatchUpdateReviewersView

Bases: DelegatedViewMixin, FormView

form_class class-attribute instance-attribute

context_name class-attribute instance-attribute

context_name = 'batch_reviewer_form'

setup

setup(request, *args, **kwargs)

Initialize attributes shared by all view methods.

Source code in hypha/apply/utils/views.py
def setup(self, request, *args, **kwargs):
    """Initialize attributes shared by all view methods."""
    self.request = request
    self.args = args
    self.kwargs = kwargs

get_object

get_object()
Source code in hypha/apply/utils/views.py
def get_object(self):
    # Make sure the form instance, bound at the parent class level,  is the same as the
    # value we work with on the class.
    # If we don't have self.object, bind the parent instance to it. This value will then
    # be used by the form. Any further calls to get_object will get a new instance of the object
    if not hasattr(self, "object"):
        parent_object = self.get_parent_object()
        if isinstance(parent_object, self.model):
            return parent_object

    return super().get_object()

get_template_names

get_template_names()
Source code in hypha/apply/utils/views.py
def get_template_names(self):
    return self.kwargs["template_names"]

get_form_name

get_form_name()
Source code in hypha/apply/utils/views.py
def get_form_name(self):
    return self.context_name

get_form_kwargs

get_form_kwargs()
Source code in hypha/apply/utils/views.py
def get_form_kwargs(self):
    form_kwargs = super().get_form_kwargs()
    form_kwargs["user"] = self.request.user
    form_kwargs.update(**self.get_parent_kwargs())
    return form_kwargs

get_parent_kwargs

get_parent_kwargs()
Source code in hypha/apply/utils/views.py
def get_parent_kwargs(self):
    try:
        return self.parent.get_form_kwargs()
    except AttributeError:
        return self.kwargs["parent"].get_form_kwargs()

get_parent_object

get_parent_object()
Source code in hypha/apply/utils/views.py
def get_parent_object(self):
    return self.get_parent_kwargs()["instance"]

get_form

get_form(*args, **kwargs)
Source code in hypha/apply/utils/views.py
def get_form(self, *args, **kwargs):
    form = super().get_form(*args, **kwargs)
    form.name = self.get_form_name()
    return form

get_context_data

get_context_data(**kwargs)
Source code in hypha/apply/utils/views.py
def get_context_data(self, **kwargs):
    # Use the previous context but override the validated form
    form = kwargs.pop("form")
    kwargs.update(self.kwargs["context"])
    kwargs.update(**{self.context_name: form})
    return super().get_context_data(**kwargs)

is_model_form classmethod

is_model_form()
Source code in hypha/apply/utils/views.py
@classmethod
def is_model_form(cls):
    return issubclass(cls.form_class, ModelForm)

contribute_form

contribute_form(parent)
Source code in hypha/apply/utils/views.py
def contribute_form(self, parent):
    self.parent = parent

    # We do not want to bind any forms generated this way
    # pretend we are doing a get request to avoid passing data to forms
    old_method = None
    if self.request.method in ("POST", "PUT"):
        old_method = self.request.method
        self.request.method = "GET"

    form = self.get_form()

    if old_method:
        self.request.method = old_method
    return self.context_name, form

get_success_url

get_success_url()
Source code in hypha/apply/utils/views.py
def get_success_url(self):
    query = self.request.GET.urlencode()
    if query:
        query = "?" + query
    return self.request.path + query

form_valid

form_valid(form)
Source code in hypha/apply/funds/views.py
def form_valid(self, form):
    submissions = form.cleaned_data["submissions"]
    external_reviewers = form.cleaned_data["external_reviewers"]
    assigned_roles = {
        role: form.cleaned_data[field] for field, role in form.role_fields.items()
    }
    services.bulk_update_reviewers(
        submissions=submissions,
        external_reviewers=external_reviewers,
        assigned_roles=assigned_roles,
        user=self.request.user,
        request=self.request,
    )

    return super().form_valid(form)

form_invalid

form_invalid(form)
Source code in hypha/apply/funds/views.py
def form_invalid(self, form):
    messages.error(
        self.request,
        mark_safe(_("Sorry something went wrong") + form.errors.as_ul()),
    )
    return super().form_invalid(form)

BatchDeleteSubmissionView

Bases: DelegatedViewMixin, FormView

form_class class-attribute instance-attribute

context_name class-attribute instance-attribute

context_name = 'batch_delete_submission_form'

setup

setup(request, *args, **kwargs)

Initialize attributes shared by all view methods.

Source code in hypha/apply/utils/views.py
def setup(self, request, *args, **kwargs):
    """Initialize attributes shared by all view methods."""
    self.request = request
    self.args = args
    self.kwargs = kwargs

get_object

get_object()
Source code in hypha/apply/utils/views.py
def get_object(self):
    # Make sure the form instance, bound at the parent class level,  is the same as the
    # value we work with on the class.
    # If we don't have self.object, bind the parent instance to it. This value will then
    # be used by the form. Any further calls to get_object will get a new instance of the object
    if not hasattr(self, "object"):
        parent_object = self.get_parent_object()
        if isinstance(parent_object, self.model):
            return parent_object

    return super().get_object()

get_template_names

get_template_names()
Source code in hypha/apply/utils/views.py
def get_template_names(self):
    return self.kwargs["template_names"]

get_form_name

get_form_name()
Source code in hypha/apply/utils/views.py
def get_form_name(self):
    return self.context_name

get_form_kwargs

get_form_kwargs()
Source code in hypha/apply/utils/views.py
def get_form_kwargs(self):
    form_kwargs = super().get_form_kwargs()
    form_kwargs["user"] = self.request.user
    form_kwargs.update(**self.get_parent_kwargs())
    return form_kwargs

get_parent_kwargs

get_parent_kwargs()
Source code in hypha/apply/utils/views.py
def get_parent_kwargs(self):
    try:
        return self.parent.get_form_kwargs()
    except AttributeError:
        return self.kwargs["parent"].get_form_kwargs()

get_parent_object

get_parent_object()
Source code in hypha/apply/utils/views.py
def get_parent_object(self):
    return self.get_parent_kwargs()["instance"]

get_form

get_form(*args, **kwargs)
Source code in hypha/apply/utils/views.py
def get_form(self, *args, **kwargs):
    form = super().get_form(*args, **kwargs)
    form.name = self.get_form_name()
    return form

get_context_data

get_context_data(**kwargs)
Source code in hypha/apply/utils/views.py
def get_context_data(self, **kwargs):
    # Use the previous context but override the validated form
    form = kwargs.pop("form")
    kwargs.update(self.kwargs["context"])
    kwargs.update(**{self.context_name: form})
    return super().get_context_data(**kwargs)

is_model_form classmethod

is_model_form()
Source code in hypha/apply/utils/views.py
@classmethod
def is_model_form(cls):
    return issubclass(cls.form_class, ModelForm)

contribute_form

contribute_form(parent)
Source code in hypha/apply/utils/views.py
def contribute_form(self, parent):
    self.parent = parent

    # We do not want to bind any forms generated this way
    # pretend we are doing a get request to avoid passing data to forms
    old_method = None
    if self.request.method in ("POST", "PUT"):
        old_method = self.request.method
        self.request.method = "GET"

    form = self.get_form()

    if old_method:
        self.request.method = old_method
    return self.context_name, form

get_success_url

get_success_url()
Source code in hypha/apply/utils/views.py
def get_success_url(self):
    query = self.request.GET.urlencode()
    if query:
        query = "?" + query
    return self.request.path + query

form_valid

form_valid(form)
Source code in hypha/apply/funds/views.py
def form_valid(self, form):
    submissions = form.cleaned_data["submissions"]
    services.bulk_delete_submissions(
        submissions=submissions,
        user=self.request.user,
        request=self.request,
    )
    return super().form_valid(form)

form_invalid

form_invalid(form)
Source code in hypha/apply/funds/views.py
def form_invalid(self, form):
    messages.error(
        self.request,
        mark_safe(_("Sorry something went wrong") + form.errors.as_ul()),
    )
    return super().form_invalid(form)

BatchArchiveSubmissionView

Bases: DelegatedViewMixin, FormView

form_class class-attribute instance-attribute

context_name class-attribute instance-attribute

context_name = 'batch_archive_submission_form'

setup

setup(request, *args, **kwargs)

Initialize attributes shared by all view methods.

Source code in hypha/apply/utils/views.py
def setup(self, request, *args, **kwargs):
    """Initialize attributes shared by all view methods."""
    self.request = request
    self.args = args
    self.kwargs = kwargs

get_object

get_object()
Source code in hypha/apply/utils/views.py
def get_object(self):
    # Make sure the form instance, bound at the parent class level,  is the same as the
    # value we work with on the class.
    # If we don't have self.object, bind the parent instance to it. This value will then
    # be used by the form. Any further calls to get_object will get a new instance of the object
    if not hasattr(self, "object"):
        parent_object = self.get_parent_object()
        if isinstance(parent_object, self.model):
            return parent_object

    return super().get_object()

get_template_names

get_template_names()
Source code in hypha/apply/utils/views.py
def get_template_names(self):
    return self.kwargs["template_names"]

get_form_name

get_form_name()
Source code in hypha/apply/utils/views.py
def get_form_name(self):
    return self.context_name

get_form_kwargs

get_form_kwargs()
Source code in hypha/apply/utils/views.py
def get_form_kwargs(self):
    form_kwargs = super().get_form_kwargs()
    form_kwargs["user"] = self.request.user
    form_kwargs.update(**self.get_parent_kwargs())
    return form_kwargs

get_parent_kwargs

get_parent_kwargs()
Source code in hypha/apply/utils/views.py
def get_parent_kwargs(self):
    try:
        return self.parent.get_form_kwargs()
    except AttributeError:
        return self.kwargs["parent"].get_form_kwargs()

get_parent_object

get_parent_object()
Source code in hypha/apply/utils/views.py
def get_parent_object(self):
    return self.get_parent_kwargs()["instance"]

get_form

get_form(*args, **kwargs)
Source code in hypha/apply/utils/views.py
def get_form(self, *args, **kwargs):
    form = super().get_form(*args, **kwargs)
    form.name = self.get_form_name()
    return form

get_context_data

get_context_data(**kwargs)
Source code in hypha/apply/utils/views.py
def get_context_data(self, **kwargs):
    # Use the previous context but override the validated form
    form = kwargs.pop("form")
    kwargs.update(self.kwargs["context"])
    kwargs.update(**{self.context_name: form})
    return super().get_context_data(**kwargs)

is_model_form classmethod

is_model_form()
Source code in hypha/apply/utils/views.py
@classmethod
def is_model_form(cls):
    return issubclass(cls.form_class, ModelForm)

contribute_form

contribute_form(parent)
Source code in hypha/apply/utils/views.py
def contribute_form(self, parent):
    self.parent = parent

    # We do not want to bind any forms generated this way
    # pretend we are doing a get request to avoid passing data to forms
    old_method = None
    if self.request.method in ("POST", "PUT"):
        old_method = self.request.method
        self.request.method = "GET"

    form = self.get_form()

    if old_method:
        self.request.method = old_method
    return self.context_name, form

get_success_url

get_success_url()
Source code in hypha/apply/utils/views.py
def get_success_url(self):
    query = self.request.GET.urlencode()
    if query:
        query = "?" + query
    return self.request.path + query

form_valid

form_valid(form)
Source code in hypha/apply/funds/views.py
def form_valid(self, form):
    # If a user without archive edit access is somehow able to access batch archive submissions
    # (ie. they were looking at the submission list when permissions changed) "refresh" the page
    if not can_alter_archived_submissions(self.request.user):
        return HttpResponseRedirect(self.request.path)
    submissions = form.cleaned_data["submissions"]
    services.bulk_archive_submissions(
        submissions=submissions,
        user=self.request.user,
        request=self.request,
    )
    return super().form_valid(form)

form_invalid

form_invalid(form)
Source code in hypha/apply/funds/views.py
def form_invalid(self, form):
    messages.error(
        self.request,
        mark_safe(_("Sorry something went wrong") + form.errors.as_ul()),
    )
    return super().form_invalid(form)

BatchProgressSubmissionView

Bases: DelegatedViewMixin, FormView

form_class class-attribute instance-attribute

context_name class-attribute instance-attribute

context_name = 'batch_progress_form'

setup

setup(request, *args, **kwargs)

Initialize attributes shared by all view methods.

Source code in hypha/apply/utils/views.py
def setup(self, request, *args, **kwargs):
    """Initialize attributes shared by all view methods."""
    self.request = request
    self.args = args
    self.kwargs = kwargs

get_object

get_object()
Source code in hypha/apply/utils/views.py
def get_object(self):
    # Make sure the form instance, bound at the parent class level,  is the same as the
    # value we work with on the class.
    # If we don't have self.object, bind the parent instance to it. This value will then
    # be used by the form. Any further calls to get_object will get a new instance of the object
    if not hasattr(self, "object"):
        parent_object = self.get_parent_object()
        if isinstance(parent_object, self.model):
            return parent_object

    return super().get_object()

get_template_names

get_template_names()
Source code in hypha/apply/utils/views.py
def get_template_names(self):
    return self.kwargs["template_names"]

get_form_name

get_form_name()
Source code in hypha/apply/utils/views.py
def get_form_name(self):
    return self.context_name

get_form_kwargs

get_form_kwargs()
Source code in hypha/apply/utils/views.py
def get_form_kwargs(self):
    form_kwargs = super().get_form_kwargs()
    form_kwargs["user"] = self.request.user
    form_kwargs.update(**self.get_parent_kwargs())
    return form_kwargs

get_parent_kwargs

get_parent_kwargs()
Source code in hypha/apply/utils/views.py
def get_parent_kwargs(self):
    try:
        return self.parent.get_form_kwargs()
    except AttributeError:
        return self.kwargs["parent"].get_form_kwargs()

get_parent_object

get_parent_object()
Source code in hypha/apply/utils/views.py
def get_parent_object(self):
    return self.get_parent_kwargs()["instance"]

get_form

get_form(*args, **kwargs)
Source code in hypha/apply/utils/views.py
def get_form(self, *args, **kwargs):
    form = super().get_form(*args, **kwargs)
    form.name = self.get_form_name()
    return form

get_context_data

get_context_data(**kwargs)
Source code in hypha/apply/utils/views.py
def get_context_data(self, **kwargs):
    # Use the previous context but override the validated form
    form = kwargs.pop("form")
    kwargs.update(self.kwargs["context"])
    kwargs.update(**{self.context_name: form})
    return super().get_context_data(**kwargs)

is_model_form classmethod

is_model_form()
Source code in hypha/apply/utils/views.py
@classmethod
def is_model_form(cls):
    return issubclass(cls.form_class, ModelForm)

contribute_form

contribute_form(parent)
Source code in hypha/apply/utils/views.py
def contribute_form(self, parent):
    self.parent = parent

    # We do not want to bind any forms generated this way
    # pretend we are doing a get request to avoid passing data to forms
    old_method = None
    if self.request.method in ("POST", "PUT"):
        old_method = self.request.method
        self.request.method = "GET"

    form = self.get_form()

    if old_method:
        self.request.method = old_method
    return self.context_name, form

get_success_url

get_success_url()
Source code in hypha/apply/utils/views.py
def get_success_url(self):
    query = self.request.GET.urlencode()
    if query:
        query = "?" + query
    return self.request.path + query

form_valid

form_valid(form)
Source code in hypha/apply/funds/views.py
def form_valid(self, form):
    submissions = form.cleaned_data["submissions"]
    transitions = form.cleaned_data.get("action")

    try:
        redirect = BatchDeterminationCreateView.should_redirect(
            self.request, submissions, transitions
        )
    except ValueError as e:
        messages.warning(self.request, "Could not determine: " + str(e))
        return self.form_invalid(form)
    else:
        if redirect:
            return redirect

    failed = []
    phase_changes = {}
    for submission in submissions:
        valid_actions = {
            action
            for action, _ in submission.get_actions_for_user(self.request.user)
        }
        old_phase = submission.phase
        try:
            transition = (valid_actions & set(transitions)).pop()
            submission.perform_transition(
                transition,
                self.request.user,
                request=self.request,
                notify=False,
            )
        except (PermissionDenied, KeyError):
            failed.append(submission)
        else:
            phase_changes[submission.id] = old_phase

    if failed:
        messages.warning(
            self.request,
            _("Failed to update: ")
            + ", ".join(str(submission) for submission in failed),
        )

    succeeded_submissions = submissions.exclude(
        id__in=[submission.id for submission in failed]
    )
    messenger(
        MESSAGES.BATCH_TRANSITION,
        user=self.request.user,
        request=self.request,
        sources=succeeded_submissions,
        related=phase_changes,
    )

    ready_for_review = [phase for phase in transitions if phase in review_statuses]
    if ready_for_review:
        messenger(
            MESSAGES.BATCH_READY_FOR_REVIEW,
            user=self.request.user,
            request=self.request,
            sources=succeeded_submissions.filter(status__in=ready_for_review),
        )

    return super().form_valid(form)

BaseReviewerSubmissionsTable

Bases: BaseAdminSubmissionsTable

filter_action class-attribute instance-attribute

filter_action = ''

search_action class-attribute instance-attribute

search_action = ''

paginator_class class-attribute instance-attribute

paginator_class = LazyPaginator

table_pagination class-attribute instance-attribute

table_pagination = {'per_page': 25}

excluded_fields class-attribute instance-attribute

excluded_fields = SUBMISSIONS_TABLE_EXCLUDED_FIELDS

excluded property

excluded

table_class class-attribute instance-attribute

filterset_class class-attribute instance-attribute

get_table_kwargs

get_table_kwargs(**kwargs)
Source code in hypha/apply/funds/views.py
def get_table_kwargs(self, **kwargs):
    return {**self.excluded, **kwargs}

get_filterset_kwargs

get_filterset_kwargs(filterset_class, **kwargs)
Source code in hypha/apply/funds/views.py
def get_filterset_kwargs(self, filterset_class, **kwargs):
    new_kwargs = super().get_filterset_kwargs(filterset_class)
    new_kwargs.update(self.excluded)
    new_kwargs.update(kwargs)
    return new_kwargs

get_context_data

get_context_data(**kwargs)
Source code in hypha/apply/funds/views.py
def get_context_data(self, **kwargs):
    search_term = self.request.GET.get("query")

    return super().get_context_data(
        search_term=search_term,
        search_action=self.search_action,
        filter_action=self.filter_action,
        **kwargs,
    )

get_queryset

get_queryset()

If use_settings variable is set for ReviewerSettings use settings parameters to filter submissions or return only reviewed_by as it was by default.

Source code in hypha/apply/funds/views.py
def get_queryset(self):
    """
    If use_settings variable is set for ReviewerSettings use settings
    parameters to filter submissions or return only reviewed_by as it
    was by default.
    """
    reviewer_settings = ReviewerSettings.for_request(self.request)
    if reviewer_settings.use_settings:
        return (
            super()
            .get_queryset()
            .for_reviewer_settings(self.request.user, reviewer_settings)
            .order_by("-submit_time")
        )
    return super().get_queryset().reviewed_by(self.request.user)

AwaitingReviewSubmissionsListView

Bases: SingleTableMixin, ListView

model class-attribute instance-attribute

table_class class-attribute instance-attribute

table_class = AdminSubmissionsTable

template_name class-attribute instance-attribute

template_name = 'funds/submissions_awaiting_review.html'

paginator_class class-attribute instance-attribute

paginator_class = LazyPaginator

table_pagination class-attribute instance-attribute

table_pagination = {'per_page': 25}

excluded_fields class-attribute instance-attribute

excluded_fields = SUBMISSIONS_TABLE_EXCLUDED_FIELDS

excluded property

excluded

get_table_kwargs

get_table_kwargs(**kwargs)
Source code in hypha/apply/funds/views.py
def get_table_kwargs(self, **kwargs):
    return {**self.excluded, **kwargs}

get_queryset

get_queryset()
Source code in hypha/apply/funds/views.py
def get_queryset(self):
    submissions = ApplicationSubmission.objects.in_review_for(
        self.request.user
    ).order_by("-submit_time")
    return submissions.for_table(self.request.user)

SubmissionOverviewView

Bases: BaseAdminSubmissionsTable

filterset_class class-attribute instance-attribute

filterset_class = SubmissionFilterAndSearch

paginator_class class-attribute instance-attribute

paginator_class = LazyPaginator

excluded_fields class-attribute instance-attribute

excluded_fields = SUBMISSIONS_TABLE_EXCLUDED_FIELDS

excluded property

excluded

template_name class-attribute instance-attribute

template_name = 'funds/submissions_overview.html'

table_class class-attribute instance-attribute

table_pagination class-attribute instance-attribute

table_pagination = False

filter_action class-attribute instance-attribute

filter_action = reverse_lazy('funds:submissions:list')

search_action class-attribute instance-attribute

search_action = reverse_lazy('funds:submissions:list')

get_table_kwargs

get_table_kwargs(**kwargs)
Source code in hypha/apply/funds/views.py
def get_table_kwargs(self, **kwargs):
    return {**self.excluded, **kwargs}

get_filterset_kwargs

get_filterset_kwargs(filterset_class, **kwargs)
Source code in hypha/apply/funds/views.py
def get_filterset_kwargs(self, filterset_class, **kwargs):
    new_kwargs = super().get_filterset_kwargs(filterset_class)
    new_kwargs.update(self.excluded)
    new_kwargs.update(kwargs)
    return new_kwargs

get_queryset

get_queryset()
Source code in hypha/apply/funds/views.py
def get_queryset(self):
    submissions = self.filterset_class._meta.model.objects.current().for_table(
        self.request.user
    )

    if not can_access_drafts(self.request.user):
        submissions = submissions.exclude_draft()

    return submissions

get_table_data

get_table_data()
Source code in hypha/apply/funds/views.py
def get_table_data(self):
    limit = 5
    return (
        super()
        .get_table_data()
        .order_by(F("last_update").desc(nulls_last=True))[:limit]
    )

get_context_data

get_context_data(**kwargs)
Source code in hypha/apply/funds/views.py
def get_context_data(self, **kwargs):
    limit = 6
    base_query = (
        RoundsAndLabs.objects.with_progress().active().order_by("-end_date")
    )
    can_export = can_export_submissions(self.request.user)
    open_rounds = base_query.open()[:limit]
    open_query = "?round_state=open"
    closed_rounds = base_query.closed()[:limit]
    closed_query = "?round_state=closed"
    rounds_title = "All Rounds and Labs"

    status_counts = dict(
        ApplicationSubmission.objects.current()
        .values("status")
        .annotate(
            count=Count("status"),
        )
        .values_list("status", "count")
    )

    grouped_statuses = {
        status: {
            "name": data["name"],
            "count": sum(
                status_counts.get(status, 0) for status in data["statuses"]
            ),
            "url": reverse_lazy(
                "funds:submissions:status", kwargs={"status": status}
            ),
        }
        for status, data in PHASES_MAPPING.items()
    }

    staff_flagged = self.get_staff_flagged()

    return super().get_context_data(
        open_rounds=open_rounds,
        open_query=open_query,
        can_export=can_export,
        closed_rounds=closed_rounds,
        closed_query=closed_query,
        rounds_title=rounds_title,
        status_counts=grouped_statuses,
        staff_flagged=staff_flagged,
        **kwargs,
    )

get_staff_flagged

get_staff_flagged()
Source code in hypha/apply/funds/views.py
def get_staff_flagged(self):
    qs = super().get_queryset().flagged_staff().order_by("-submit_time")
    row_attrs = dict(
        {"data-flag-type": "staff"}, **SummarySubmissionsTable._meta.row_attrs
    )

    limit = 5
    return {
        "table": SummarySubmissionsTable(
            qs[:limit],
            prefix="staff-flagged-",
            attrs={"class": "all-submissions-table flagged-table"},
            row_attrs=row_attrs,
        ),
        "display_more": qs.count() > limit,
    }

SubmissionAdminListView

SubmissionAdminListView(*args, **kwargs)

Bases: BaseAdminSubmissionsTable, DelegateableListView

Source code in hypha/apply/utils/views.py
def __init__(self, *args, **kwargs):
    self._form_views = {
        self.form_prefix + form_view.context_name: form_view
        for form_view in self.form_views
    }

form_prefix class-attribute instance-attribute

form_prefix = 'form-submitted-'

table_class class-attribute instance-attribute

table_class = AdminSubmissionsTable

filterset_class class-attribute instance-attribute

filterset_class = SubmissionFilterAndSearch

filter_action class-attribute instance-attribute

filter_action = ''

search_action class-attribute instance-attribute

search_action = ''

paginator_class class-attribute instance-attribute

paginator_class = LazyPaginator

table_pagination class-attribute instance-attribute

table_pagination = {'per_page': 25}

excluded_fields class-attribute instance-attribute

excluded_fields = SUBMISSIONS_TABLE_EXCLUDED_FIELDS

excluded property

excluded

template_name class-attribute instance-attribute

template_name = 'funds/submissions.html'

get_form_kwargs

get_form_kwargs()
Source code in hypha/apply/utils/views.py
def get_form_kwargs(self):
    return {
        "user": self.request.user,
    }

post

post(request, *args, **kwargs)
Source code in hypha/apply/utils/views.py
def post(self, request, *args, **kwargs):
    self.object_list = self.get_queryset()
    return super().post(request, *args, **kwargs)

get_table_kwargs

get_table_kwargs(**kwargs)
Source code in hypha/apply/funds/views.py
def get_table_kwargs(self, **kwargs):
    return {**self.excluded, **kwargs}

get_filterset_kwargs

get_filterset_kwargs(filterset_class, **kwargs)
Source code in hypha/apply/funds/views.py
def get_filterset_kwargs(self, filterset_class, **kwargs):
    new_kwargs = super().get_filterset_kwargs(filterset_class)
    archived_kwargs = {"archived": self.request.GET.get("archived", 0)}
    new_kwargs.update(archived_kwargs)
    new_kwargs.update(kwargs)
    return new_kwargs

get_queryset

get_queryset()
Source code in hypha/apply/funds/views.py
def get_queryset(self):
    if self.request.GET.get("archived"):
        # if archived is in param, let archived filter handle the queryset as per its value.
        submissions = (
            self.filterset_class._meta.model.objects.include_archive().for_table(
                self.request.user
            )
        )
    else:
        submissions = self.filterset_class._meta.model.objects.current().for_table(
            self.request.user
        )

    if not can_access_drafts(self.request.user):
        submissions = submissions.exclude_draft()

    return submissions

get_context_data

get_context_data(**kwargs)
Source code in hypha/apply/funds/views.py
def get_context_data(self, **kwargs):
    show_archive = can_view_archived_submissions(self.request.user)
    can_archive = can_bulk_archive_submissions(self.request.user)

    return super().get_context_data(
        show_archive=show_archive,
        can_bulk_archive=can_archive,
        **kwargs,
    )

GroupingApplicationsListView

Bases: TemplateView

Template view for grouped submissions

template_name class-attribute instance-attribute

template_name = 'funds/grouped_application_list.html'

SubmissionReviewerListView

Bases: BaseReviewerSubmissionsTable

table_class class-attribute instance-attribute

filterset_class class-attribute instance-attribute

filter_action class-attribute instance-attribute

filter_action = ''

search_action class-attribute instance-attribute

search_action = ''

paginator_class class-attribute instance-attribute

paginator_class = LazyPaginator

table_pagination class-attribute instance-attribute

table_pagination = {'per_page': 25}

excluded_fields class-attribute instance-attribute

excluded_fields = SUBMISSIONS_TABLE_EXCLUDED_FIELDS

excluded property

excluded

template_name class-attribute instance-attribute

template_name = 'funds/submissions.html'

get_table_kwargs

get_table_kwargs(**kwargs)
Source code in hypha/apply/funds/views.py
def get_table_kwargs(self, **kwargs):
    return {**self.excluded, **kwargs}

get_filterset_kwargs

get_filterset_kwargs(filterset_class, **kwargs)
Source code in hypha/apply/funds/views.py
def get_filterset_kwargs(self, filterset_class, **kwargs):
    new_kwargs = super().get_filterset_kwargs(filterset_class)
    new_kwargs.update(self.excluded)
    new_kwargs.update(kwargs)
    return new_kwargs

get_queryset

get_queryset()

If use_settings variable is set for ReviewerSettings use settings parameters to filter submissions or return only reviewed_by as it was by default.

Source code in hypha/apply/funds/views.py
def get_queryset(self):
    """
    If use_settings variable is set for ReviewerSettings use settings
    parameters to filter submissions or return only reviewed_by as it
    was by default.
    """
    reviewer_settings = ReviewerSettings.for_request(self.request)
    if reviewer_settings.use_settings:
        return (
            super()
            .get_queryset()
            .for_reviewer_settings(self.request.user, reviewer_settings)
            .order_by("-submit_time")
        )
    return super().get_queryset().reviewed_by(self.request.user)

get_context_data

get_context_data(**kwargs)
Source code in hypha/apply/funds/views.py
def get_context_data(self, **kwargs):
    search_term = self.request.GET.get("query")

    return super().get_context_data(
        search_term=search_term,
        search_action=self.search_action,
        filter_action=self.filter_action,
        **kwargs,
    )

SubmissionListView

Bases: ViewDispatcher

partner_view class-attribute instance-attribute

partner_view = None

community_view class-attribute instance-attribute

community_view = None

applicant_view class-attribute instance-attribute

applicant_view = None

finance_view class-attribute instance-attribute

finance_view = None

contracting_view class-attribute instance-attribute

contracting_view = None

admin_view class-attribute instance-attribute

reviewer_view class-attribute instance-attribute

admin_check

admin_check(request)
Source code in hypha/apply/utils/views.py
def admin_check(self, request):
    return request.user.is_apply_staff

reviewer_check

reviewer_check(request)
Source code in hypha/apply/utils/views.py
def reviewer_check(self, request):
    return request.user.is_reviewer

partner_check

partner_check(request)
Source code in hypha/apply/utils/views.py
def partner_check(self, request):
    return request.user.is_partner

community_check

community_check(request)
Source code in hypha/apply/utils/views.py
def community_check(self, request):
    return request.user.is_community_reviewer

finance_check

finance_check(request)
Source code in hypha/apply/utils/views.py
def finance_check(self, request):
    return request.user.is_finance

contracting_check

contracting_check(request)
Source code in hypha/apply/utils/views.py
def contracting_check(self, request):
    return request.user.is_contracting

applicant_check

applicant_check(request)
Source code in hypha/apply/utils/views.py
def applicant_check(self, request):
    return request.user.is_applicant

dispatch

dispatch(request, *args, **kwargs)
Source code in hypha/apply/utils/views.py
def dispatch(self, request, *args, **kwargs):
    view = None

    if self.admin_check(request):
        view = self.admin_view
    elif self.reviewer_check(request):
        view = self.reviewer_view
    elif self.partner_check(request):
        view = self.partner_view
    elif self.community_check(request):
        view = self.community_view
    elif self.finance_check(request):
        view = self.finance_view
    elif self.contracting_check(request):
        view = self.contracting_view
    elif self.applicant_check(request):
        view = self.applicant_view

    if view:
        return view.as_view()(request, *args, **kwargs)
    return HttpResponseForbidden()

SubmissionStaffFlaggedView

Bases: BaseAdminSubmissionsTable

table_class class-attribute instance-attribute

table_class = AdminSubmissionsTable

filterset_class class-attribute instance-attribute

filterset_class = SubmissionFilterAndSearch

filter_action class-attribute instance-attribute

filter_action = ''

search_action class-attribute instance-attribute

search_action = ''

paginator_class class-attribute instance-attribute

paginator_class = LazyPaginator

table_pagination class-attribute instance-attribute

table_pagination = {'per_page': 25}

excluded_fields class-attribute instance-attribute

excluded_fields = SUBMISSIONS_TABLE_EXCLUDED_FIELDS

excluded property

excluded

template_name class-attribute instance-attribute

template_name = 'funds/submissions_staff_flagged.html'

get_table_kwargs

get_table_kwargs(**kwargs)
Source code in hypha/apply/funds/views.py
def get_table_kwargs(self, **kwargs):
    return {**self.excluded, **kwargs}

get_filterset_kwargs

get_filterset_kwargs(filterset_class, **kwargs)
Source code in hypha/apply/funds/views.py
def get_filterset_kwargs(self, filterset_class, **kwargs):
    new_kwargs = super().get_filterset_kwargs(filterset_class)
    new_kwargs.update(self.excluded)
    new_kwargs.update(kwargs)
    return new_kwargs

get_context_data

get_context_data(**kwargs)
Source code in hypha/apply/funds/views.py
def get_context_data(self, **kwargs):
    search_term = self.request.GET.get("query")

    return super().get_context_data(
        search_term=search_term,
        search_action=self.search_action,
        filter_action=self.filter_action,
        **kwargs,
    )

get_queryset

get_queryset()
Source code in hypha/apply/funds/views.py
def get_queryset(self):
    return (
        self.filterset_class._meta.model.objects.current()
        .for_table(self.request.user)
        .flagged_staff()
        .order_by("-submit_time")
    )

SubmissionUserFlaggedView

Bases: UserPassesTestMixin, BaseAdminSubmissionsTable

table_class class-attribute instance-attribute

table_class = AdminSubmissionsTable

filterset_class class-attribute instance-attribute

filterset_class = SubmissionFilterAndSearch

filter_action class-attribute instance-attribute

filter_action = ''

search_action class-attribute instance-attribute

search_action = ''

paginator_class class-attribute instance-attribute

paginator_class = LazyPaginator

table_pagination class-attribute instance-attribute

table_pagination = {'per_page': 25}

excluded_fields class-attribute instance-attribute

excluded_fields = SUBMISSIONS_TABLE_EXCLUDED_FIELDS

excluded property

excluded

template_name class-attribute instance-attribute

template_name = 'funds/submissions_user_flagged.html'

get_table_kwargs

get_table_kwargs(**kwargs)
Source code in hypha/apply/funds/views.py
def get_table_kwargs(self, **kwargs):
    return {**self.excluded, **kwargs}

get_filterset_kwargs

get_filterset_kwargs(filterset_class, **kwargs)
Source code in hypha/apply/funds/views.py
def get_filterset_kwargs(self, filterset_class, **kwargs):
    new_kwargs = super().get_filterset_kwargs(filterset_class)
    new_kwargs.update(self.excluded)
    new_kwargs.update(kwargs)
    return new_kwargs

get_context_data

get_context_data(**kwargs)
Source code in hypha/apply/funds/views.py
def get_context_data(self, **kwargs):
    search_term = self.request.GET.get("query")

    return super().get_context_data(
        search_term=search_term,
        search_action=self.search_action,
        filter_action=self.filter_action,
        **kwargs,
    )

get_queryset

get_queryset()
Source code in hypha/apply/funds/views.py
def get_queryset(self):
    return (
        self.filterset_class._meta.model.objects.current()
        .for_table(self.request.user)
        .flagged_by(self.request.user)
        .order_by("-submit_time")
    )

test_func

test_func()
Source code in hypha/apply/funds/views.py
def test_func(self):
    return self.request.user.is_apply_staff or self.request.user.is_reviewer

ExportSubmissionsByRound

Bases: UserPassesTestMixin, BaseAdminSubmissionsTable

table_class class-attribute instance-attribute

table_class = AdminSubmissionsTable

filterset_class class-attribute instance-attribute

filterset_class = SubmissionFilterAndSearch

filter_action class-attribute instance-attribute

filter_action = ''

search_action class-attribute instance-attribute

search_action = ''

paginator_class class-attribute instance-attribute

paginator_class = LazyPaginator

table_pagination class-attribute instance-attribute

table_pagination = {'per_page': 25}

excluded_fields class-attribute instance-attribute

excluded_fields = SUBMISSIONS_TABLE_EXCLUDED_FIELDS

excluded property

excluded

get_table_kwargs

get_table_kwargs(**kwargs)
Source code in hypha/apply/funds/views.py
def get_table_kwargs(self, **kwargs):
    return {**self.excluded, **kwargs}

get_filterset_kwargs

get_filterset_kwargs(filterset_class, **kwargs)
Source code in hypha/apply/funds/views.py
def get_filterset_kwargs(self, filterset_class, **kwargs):
    new_kwargs = super().get_filterset_kwargs(filterset_class)
    new_kwargs.update(self.excluded)
    new_kwargs.update(kwargs)
    return new_kwargs

get_context_data

get_context_data(**kwargs)
Source code in hypha/apply/funds/views.py
def get_context_data(self, **kwargs):
    search_term = self.request.GET.get("query")

    return super().get_context_data(
        search_term=search_term,
        search_action=self.search_action,
        filter_action=self.filter_action,
        **kwargs,
    )

export_submissions

export_submissions(round_id)
Source code in hypha/apply/funds/views.py
def export_submissions(self, round_id):
    csv_stream = StringIO()
    writer = csv.writer(csv_stream)
    header_row, values = [], []
    index = 0
    check = False

    for submission in ApplicationSubmission.objects.filter(round=round_id):
        for field_id in submission.question_text_field_ids:
            question_field = submission.serialize(field_id)
            field_name = question_field["question"]
            field_value = question_field["answer"]
            if field_id not in submission.named_blocks:
                header_row.append(field_name) if not check else header_row
                values.append(field_value)
            else:
                header_row.insert(index, field_name) if not check else header_row
                values.insert(index, field_value)
                index = index + 1

        if not check:
            writer.writerow(header_row)
            check = True

        writer.writerow(values)
        values.clear()
        index = 0

    csv_stream.seek(0)
    return csv_stream

get_queryset

get_queryset()
Source code in hypha/apply/funds/views.py
def get_queryset(self):
    try:
        self.obj = Page.objects.get(pk=self.kwargs.get("pk")).specific
    except Page.DoesNotExist as exc:
        raise Http404(_("No Round or Lab found matching the query")) from exc

    if not isinstance(self.obj, (LabBase, RoundBase)):
        raise Http404(_("No Round or Lab found matching the query"))
    return super().get_queryset().filter(Q(round=self.obj) | Q(page=self.obj))

get

get(request, pk)
Source code in hypha/apply/funds/views.py
def get(self, request, pk):
    self.get_queryset()
    csv_data = self.export_submissions(pk)
    response = HttpResponse(csv_data.readlines(), content_type="text/csv")
    response["Content-Disposition"] = "inline; filename=" + str(self.obj) + ".csv"
    return response

test_func

test_func()
Source code in hypha/apply/funds/views.py
def test_func(self):
    return can_export_submissions(self.request.user)

SubmissionsByRound

SubmissionsByRound(*args, **kwargs)

Bases: BaseAdminSubmissionsTable, DelegateableListView

Source code in hypha/apply/utils/views.py
def __init__(self, *args, **kwargs):
    self._form_views = {
        self.form_prefix + form_view.context_name: form_view
        for form_view in self.form_views
    }

form_prefix class-attribute instance-attribute

form_prefix = 'form-submitted-'

table_class class-attribute instance-attribute

table_class = AdminSubmissionsTable

filterset_class class-attribute instance-attribute

filterset_class = SubmissionFilterAndSearch

filter_action class-attribute instance-attribute

filter_action = ''

search_action class-attribute instance-attribute

search_action = ''

paginator_class class-attribute instance-attribute

paginator_class = LazyPaginator

table_pagination class-attribute instance-attribute

table_pagination = {'per_page': 25}

excluded property

excluded

template_name class-attribute instance-attribute

template_name = 'funds/submissions_by_round.html'

excluded_fields class-attribute instance-attribute

excluded_fields = ['round', 'fund'] + SUBMISSIONS_TABLE_EXCLUDED_FIELDS

post

post(request, *args, **kwargs)
Source code in hypha/apply/utils/views.py
def post(self, request, *args, **kwargs):
    self.object_list = self.get_queryset()
    return super().post(request, *args, **kwargs)

get_table_kwargs

get_table_kwargs(**kwargs)
Source code in hypha/apply/funds/views.py
def get_table_kwargs(self, **kwargs):
    return {**self.excluded, **kwargs}

get_filterset_kwargs

get_filterset_kwargs(filterset_class, **kwargs)
Source code in hypha/apply/funds/views.py
def get_filterset_kwargs(self, filterset_class, **kwargs):
    new_kwargs = super().get_filterset_kwargs(filterset_class)
    new_kwargs.update(self.excluded)
    new_kwargs.update(kwargs)
    return new_kwargs

get_form_kwargs

get_form_kwargs()
Source code in hypha/apply/funds/views.py
def get_form_kwargs(self):
    kwargs = super().get_form_kwargs()
    kwargs["round"] = self.obj
    return kwargs

get_queryset

get_queryset()
Source code in hypha/apply/funds/views.py
def get_queryset(self):
    # We want to only show lab or Rounds in this view, their base class is Page
    try:
        self.obj = Page.objects.get(pk=self.kwargs.get("pk")).specific
    except Page.DoesNotExist as e:
        raise Http404(_("No Round or Lab found matching the query")) from e

    if not isinstance(self.obj, (LabBase, RoundBase)):
        raise Http404(_("No Round or Lab found matching the query"))
    return super().get_queryset().filter(Q(round=self.obj) | Q(page=self.obj))

get_context_data

get_context_data(**kwargs)
Source code in hypha/apply/funds/views.py
def get_context_data(self, **kwargs):
    return super().get_context_data(object=self.obj, **kwargs)

SubmissionsByStatus

SubmissionsByStatus(*args, **kwargs)

Bases: BaseAdminSubmissionsTable, DelegateableListView

Source code in hypha/apply/utils/views.py
def __init__(self, *args, **kwargs):
    self._form_views = {
        self.form_prefix + form_view.context_name: form_view
        for form_view in self.form_views
    }

form_prefix class-attribute instance-attribute

form_prefix = 'form-submitted-'

table_class class-attribute instance-attribute

table_class = AdminSubmissionsTable

filterset_class class-attribute instance-attribute

filterset_class = SubmissionFilterAndSearch

filter_action class-attribute instance-attribute

filter_action = ''

search_action class-attribute instance-attribute

search_action = ''

paginator_class class-attribute instance-attribute

paginator_class = LazyPaginator

table_pagination class-attribute instance-attribute

table_pagination = {'per_page': 25}

excluded_fields class-attribute instance-attribute

excluded_fields = SUBMISSIONS_TABLE_EXCLUDED_FIELDS

excluded property

excluded

template_name class-attribute instance-attribute

template_name = 'funds/submissions_by_status.html'

status_mapping class-attribute instance-attribute

status_mapping = PHASES_MAPPING

get_form_kwargs

get_form_kwargs()
Source code in hypha/apply/utils/views.py
def get_form_kwargs(self):
    return {
        "user": self.request.user,
    }

post

post(request, *args, **kwargs)
Source code in hypha/apply/utils/views.py
def post(self, request, *args, **kwargs):
    self.object_list = self.get_queryset()
    return super().post(request, *args, **kwargs)

get_table_kwargs

get_table_kwargs(**kwargs)
Source code in hypha/apply/funds/views.py
def get_table_kwargs(self, **kwargs):
    return {**self.excluded, **kwargs}

dispatch

dispatch(request, *args, **kwargs)
Source code in hypha/apply/funds/views.py
def dispatch(self, request, *args, **kwargs):
    self.status = kwargs.get("status")
    try:
        status_data = self.status_mapping[self.status]
    except KeyError:
        raise Http404(_("No statuses match the requested value")) from None
    self.status_name = status_data["name"]
    self.statuses = status_data["statuses"]
    return super().dispatch(request, *args, **kwargs)

get_filterset_kwargs

get_filterset_kwargs(filterset_class, **kwargs)
Source code in hypha/apply/funds/views.py
def get_filterset_kwargs(self, filterset_class, **kwargs):
    return super().get_filterset_kwargs(
        filterset_class, limit_statuses=self.statuses, **kwargs
    )

get_queryset

get_queryset()
Source code in hypha/apply/funds/views.py
def get_queryset(self):
    return super().get_queryset().filter(status__in=self.statuses)

get_context_data

get_context_data(**kwargs)
Source code in hypha/apply/funds/views.py
def get_context_data(self, **kwargs):
    return super().get_context_data(
        status=self.status_name,
        statuses=self.statuses,
        **kwargs,
    )

ProgressSubmissionView

Bases: DelegatedVi