Skip to content

Tables

hypha.apply.projects.reports.tables

ReportingTable

Bases: Table

title class-attribute instance-attribute

title = LinkColumn('funds:submissions:project', args=[A('submission_id')])

organization_name class-attribute instance-attribute

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

current_report_status class-attribute instance-attribute

current_report_status = Column(attrs={'td': {'class': 'status'}}, verbose_name='Status')

current_report_submitted_date class-attribute instance-attribute

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

current_report_due_date class-attribute instance-attribute

current_report_due_date = 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 = 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': 'reporting-table'}

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 = LinkColumn('funds:projects:reports:detail', args=[A('pk')])

report_period class-attribute instance-attribute

report_period = Column(accessor='pk')

submitted class-attribute instance-attribute

submitted = DateColumn()

lead class-attribute instance-attribute

lead = 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': 'projects-table'}

render_report_period

render_report_period(record)
Source code in hypha/apply/projects/reports/tables.py
def render_report_period(self, record):
    return f"{record.start} to {record.end_date}"

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)