Reporting framework can now display multiple sections.
This commit is contained in:
parent
25608b1653
commit
48a036204d
2 changed files with 8 additions and 2 deletions
|
@ -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)
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue