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):
|
class Report(object):
|
||||||
|
|
||||||
def __init__(self, title, headings, data, link_view=None):
|
def __init__(self, title, headings, data, link_view=None):
|
||||||
|
self._title = title
|
||||||
self._headings = headings
|
self._headings = headings
|
||||||
self._data = data
|
self._data = data
|
||||||
self._link_view = link_view
|
self._link_view = link_view
|
||||||
|
@ -66,12 +67,15 @@ def report_view(title, form_type=None):
|
||||||
else:
|
else:
|
||||||
form = None
|
form = None
|
||||||
|
|
||||||
report = view(request, form, *a, **k)
|
reports = view(request, form, *a, **k)
|
||||||
|
|
||||||
|
if isinstance(reports, Report):
|
||||||
|
reports = [reports]
|
||||||
|
|
||||||
ctx = {
|
ctx = {
|
||||||
"title": title,
|
"title": title,
|
||||||
"form": form,
|
"form": form,
|
||||||
"report": report,
|
"reports": reports,
|
||||||
}
|
}
|
||||||
|
|
||||||
return render(request, "registrasion/report.html", ctx)
|
return render(request, "registrasion/report.html", ctx)
|
||||||
|
|
|
@ -37,6 +37,8 @@ public = [
|
||||||
|
|
||||||
reports = [
|
reports = [
|
||||||
url(r"^$", reporting_views.reports_list, name="reports_list"),
|
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(
|
url(
|
||||||
r"^credit_notes/?$",
|
r"^credit_notes/?$",
|
||||||
reporting_views.credit_notes,
|
reporting_views.credit_notes,
|
||||||
|
|
Loading…
Reference in a new issue