diff --git a/registrasion/reporting/reports.py b/registrasion/reporting/reports.py index d533ecf11f3af5f9b032a28ad9354851b3876ca5..9ba63f0648d61255a5d4844b4f4f8e4858eb8792 100644 --- a/registrasion/reporting/reports.py +++ b/registrasion/reporting/reports.py @@ -118,11 +118,20 @@ class ListReport(BasicReport): class QuerysetReport(BasicReport): - def __init__(self, title, headings, attributes, queryset, link_view=None): + def __init__(self, title, attributes, queryset, headings=None, + link_view=None): super(QuerysetReport, self).__init__(title, headings, link_view=link_view) self._attributes = attributes self._queryset = queryset + def headings(self): + if self._headings is not None: + return self._headings + + return [ + " ".join(i.split("_")).capitalize() for i in self._attributes + ] + def rows(self, content_type): def rgetattr(item, attr):