Bases: SingleTableMixin
, ListView
model
class-attribute
instance-attribute
table_class
class-attribute
instance-attribute
template_name
class-attribute
instance-attribute
template_name = 'funds/staff_assignments.html'
get_queryset
Source code in hypha/apply/funds/views/staff_assignments.py
| def get_queryset(self):
# Only list staff.
return self.model.objects.staff()
|
get_table_data
Source code in hypha/apply/funds/views/staff_assignments.py
| def get_table_data(self):
table_data = super().get_table_data()
reviewer_roles = ReviewerRole.objects.all().order_by("order")
for data in table_data:
for i, _role in enumerate(reviewer_roles):
# Only setting column name with dummy value 0.
# Actual value will be set in RoleColumn render method.
setattr(data, f"role{i}", 0)
return table_data
|
get_table_kwargs
Source code in hypha/apply/funds/views/staff_assignments.py
| def get_table_kwargs(self):
reviewer_roles = ReviewerRole.objects.all().order_by("order")
extra_columns = []
for i, role in enumerate(reviewer_roles):
extra_columns.append((f"role{i}", RoleColumn(verbose_name=role)))
return {
"extra_columns": extra_columns,
}
|