Created
August 26, 2014 22:15
-
-
Save mrbaboon/c24f85084e35f79e439e to your computer and use it in GitHub Desktop.
Issue with template & class object
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
<tbody> | |
{% for report in report_list %} | |
<tr> | |
<td>{{ report.name }}</td> | |
<td>{{ report.slug }}</td> | |
<td>test</td> | |
<td> | |
<a href="{% url 'reports:report_view' slug=report.slug %}">Run Report</a> | |
</td> | |
</tr> | |
{% endfor %} | |
</tbody> | |
... | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class UsageReport(Report): | |
name = 'Usage' | |
slug = 'usage-report' | |
description = 'Outlines average delivery, read and reply times over a given period' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def report_list(request): | |
""" | |
This view render all reports registered | |
""" | |
context = { | |
'report_list': reports.get_reports() | |
# report_list would be [ UsageReport, ] | |
} | |
return render(request, 'spreports/report_list.html', context) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment