gavinzheng / django-reporting

Automatically exported from code.google.com/p/django-reporting
0 stars 0 forks source link

Override view template per report slug #12

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Hi Guys,

Great project. I think it would be a good idea to be able to override the
view model based on report slug just as changelist_view does for each model
in the admin.

The report_view would change thus - 

def view_report(request, slug):
    report = reporting.get_report(slug)(request)
    data = {'report': report, 'title':report.verbose_name}
    return render_to_response(['reporting/%s/view.html' %
slug,'reporting/view.html'], data, RequestContext(request))

I can of course create my own views but thought it would be a good addition
to the project.

Original issue reported on code.google.com by tinyviki...@gmail.com on 22 Jan 2010 at 5:57

GoogleCodeExporter commented 9 years ago
i propose reports to have 'template' attribute with default 
'reporting/view.html'.

Original comment by niki.spa...@gmail.com on 25 Feb 2010 at 8:52

GoogleCodeExporter commented 9 years ago
patch for attribute 'view_template' - name chosen similar to admin

Original comment by niki.spa...@gmail.com on 25 Feb 2010 at 9:38

Attachments: