Reporting framework can now display multiple sections.

This commit is contained in:
Christopher Neugebauer 2016-09-02 15:14:54 +10:00
parent 25608b1653
commit 48a036204d
2 changed files with 8 additions and 2 deletions

View file

@ -13,6 +13,7 @@ _all_report_views = []
class Report(object):
def __init__(self, title, headings, data, link_view=None):
self._title = title
self._headings = headings
self._data = data
self._link_view = link_view
@ -66,12 +67,15 @@ def report_view(title, form_type=None):
else:
form = None
report = view(request, form, *a, **k)
reports = view(request, form, *a, **k)
if isinstance(reports, Report):
reports = [reports]
ctx = {
"title": title,
"form": form,
"report": report,
"reports": reports,
}
return render(request, "registrasion/report.html", ctx)

View file

@ -37,6 +37,8 @@ public = [
reports = [
url(r"^$", reporting_views.reports_list, name="reports_list"),
url(r"^attendee/?$", reporting_views.attendee, name="attendee"),
url(r"^attendee/([0-9]*)$", reporting_views.attendee, name="attendee"),
url(
r"^credit_notes/?$",
reporting_views.credit_notes,