Skip to content

Models

hypha.apply.home.models

ApplyHomePage

Bases: WagtailCacheMixin, Page

parent_page_types class-attribute instance-attribute

parent_page_types = ['wagtailcore.Page']

subpage_types class-attribute instance-attribute

subpage_types = ['funds.FundType', 'funds.LabType', 'funds.RequestForPartners']

strapline class-attribute instance-attribute

strapline = CharField(blank=True, max_length=255)

search_fields class-attribute instance-attribute

search_fields = search_fields + [SearchField('strapline')]

content_panels class-attribute instance-attribute

content_panels = content_panels + [FieldPanel('strapline')]

cache_control

cache_control()
Source code in hypha/apply/home/models.py
def cache_control(self):
    return f"public, s-maxage={settings.CACHE_CONTROL_S_MAXAGE}"

get_context

get_context(*args, **kwargs)
Source code in hypha/apply/home/models.py
def get_context(self, *args, **kwargs):
    context = super().get_context(*args, **kwargs)
    context["open_funds"] = ApplicationBase.objects.order_by_end_date().specific()
    context["open_labs"] = LabBase.objects.public().live().specific()
    return context