Skip to content

Tables

hypha.apply.projects.reports.tables

ReportingTable

Bases: Table

title class-attribute instance-attribute

title = tables.LinkColumn('funds:submissions:project', args=[tables.utils.A('submission_id'), tables.utils.A('pk')], attrs={'a': {'class': 'link link-hover font-semibold break-words transition-colors line-clamp-2 max-w-md'}})

organization_name class-attribute instance-attribute

organization_name = tables.Column(accessor='submission__organization_name', verbose_name=_('Organization name'))

current_report_status class-attribute instance-attribute

current_report_status = tables.Column(attrs={'td': {'class': ''}}, verbose_name=_('Status'))

current_report_submitted_date class-attribute instance-attribute

current_report_submitted_date = tables.Column(verbose_name=_('Submitted date'), accessor='current_report_submitted_date__date')

current_report_due_date class-attribute instance-attribute

current_report_due_date = tables.Column(verbose_name=_('Due Date'), accessor='report_config__current_report__end_date')

current_report_last_notified_date class-attribute instance-attribute

current_report_last_notified_date = tables.Column(verbose_name=_('Last Notified'), accessor='report_config__current_report__notified__date')

Meta

fields class-attribute instance-attribute
fields = ['title', 'organization_name', 'current_report_due_date', 'current_report_status', 'current_report_submitted_date', 'current_report_last_notified_date']
model class-attribute instance-attribute
model = Project
orderable class-attribute instance-attribute
orderable = True
attrs class-attribute instance-attribute
attrs = {'class': 'table overflow-x-auto ReportingTable'}
row_attrs class-attribute instance-attribute
row_attrs = {'onclick': lambda record: f"window.location.href='{record.get_absolute_url()}'", 'class': 'table-row-link', 'role': 'button', 'tabindex': '0'}

render_title

render_title(record)
Source code in hypha/apply/projects/reports/tables.py
def render_title(self, record):
    return get_project_title(record)

render_current_report_status

render_current_report_status(value)
Source code in hypha/apply/projects/reports/tables.py
def render_current_report_status(self, value):
    return format_html("<span>{}</span>", value)

ReportListTable

Bases: Table

project class-attribute instance-attribute

project = tables.LinkColumn('funds:projects:reports:detail', args=[tables.utils.A('pk')], attrs={'a': {'class': 'link link-hover font-semibold break-words transition-colors line-clamp-2 max-w-md'}})

report_period class-attribute instance-attribute

report_period = tables.Column(accessor='pk')

submitted class-attribute instance-attribute

submitted = RelativeTimeColumn()

lead class-attribute instance-attribute

lead = tables.Column(accessor='project__lead')

Meta

fields class-attribute instance-attribute
fields = ['project', 'submitted']
sequence class-attribute instance-attribute
sequence = ['project', 'report_period', '...']
model class-attribute instance-attribute
model = Report
template_name class-attribute instance-attribute
template_name = 'application_projects/tables/table.html'
attrs class-attribute instance-attribute
attrs = {'class': 'table projects-table ReportListTable'}
row_attrs class-attribute instance-attribute
row_attrs = {'onclick': lambda record: f"window.location.href='{record.get_absolute_url()}'", 'class': 'table-row-link', 'role': 'button', 'tabindex': '0'}

render_report_period

render_report_period(record)
Source code in hypha/apply/projects/reports/tables.py
def render_report_period(self, record):
    return format_html(
        "<relative-time datetime='{}' prefix=''>{}</relative-time> – <relative-time datetime='{}' prefix=''>{}</relative-time>",
        record.start.isoformat(),
        record.start.strftime(settings.SHORT_DATETIME_FORMAT),
        record.end_date.isoformat(),
        record.end_date.strftime(settings.SHORT_DATETIME_FORMAT),
    )

render_project

render_project(record)
Source code in hypha/apply/projects/reports/tables.py
def render_project(self, record):
    return get_project_title(record.project)