Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'master' of github.com:nikolajbaer/django-reportengine

  • Loading branch information...
commit 076fdb3faa381622a17d31e58c048af0c83f2980 2 parents d66a0d6 + 1c5b329
@nikolajbaer authored
Showing with 4 additions and 2 deletions.
  1. +3 −2 reportengine/base.py
  2. +1 −0  reportengine/views.py
View
5 reportengine/base.py
@@ -119,13 +119,14 @@ def get_rows(self,filters={},order_by=None):
# TODO incorporate offset/limit somehow
from django.db import connection
cursor = connection.cursor()
+ # TODO named parameters don't work in SQLite3, so this doesn't hold up
if self.row_sql:
- cursor.execute(self.row_sql%filters)
+ cursor.execute(self.row_sql,filters)
rows=cursor.fetchall()
else: rows=[]
if self.aggregate_sql:
- cursor.execute(self.aggregate_sql%filters)
+ cursor.execute(self.aggregate_sql,filters)
result=cursor.fetchone() # only fetch first row
agg=[]
View
1  reportengine/views.py
@@ -26,6 +26,7 @@ def report_list(request):
# TODO build date_field redirects.. so view is at /current/<day|week|month|year>/<slug>/<format>/ and redirects
# to the appropriate date filter
# TODO assign appropriate permissions. Some reports might need to be accessible via OAuth or some other mechanism
+# TODO generate report in separate method. views should be thin!
@staff_member_required
def view_report(request, namespace, slug, output=None):
report = reportengine.get_report(namespace,slug)()
Please sign in to comment.
Something went wrong with that request. Please try again.