From: Ross Jones Date: Thu, 01 Nov 2012 10:47:46 +0000 Subject: Remove unnecessary footnote marker (*) X-Git-Url: http://maxious.lambdacomplex.org/git/?p=ckanext-ga-report.git&a=commitdiff&h=7e488c29bef34dce08bc4d8c3a33bd2c0b49c1b0 --- Remove unnecessary footnote marker (*) --- --- a/ckanext/ga_report/controller.py +++ b/ckanext/ga_report/controller.py @@ -40,6 +40,7 @@ entries = q.order_by('GA_Stat.period_name, GA_Stat.stat_name, GA_Stat.key').all() response.headers['Content-Type'] = "text/csv; charset=utf-8" + response.headers['Content-Disposition'] = str('attachment; filename=stats_%s.csv' % (month,)) writer = csv.writer(response) writer.writerow(["Period", "Statistic", "Key", "Value"]) @@ -75,7 +76,6 @@ mins, secs = divmod(float(val), 60) hours, mins = divmod(mins, 60) val = '%02d:%02d:%02d (%s seconds) ' % (hours, mins, secs, val) - key = '%s *' % key if key in ['Bounces', 'Total pageviews']: val = int(val) return key, val @@ -156,12 +156,10 @@ the datasets associated with the publisher. """ def csv(self, month): - #q = model.Session.query(GA_Stat) - #if month != 'all': - # q = q.filter(GA_Stat.period_name==month) - #entries = q.order_by('GA_Stat.period_name, GA_Stat.stat_name, GA_Stat.key').all() + c.month = month if not month =='all' else '' response.headers['Content-Type'] = "text/csv; charset=utf-8" + response.headers['Content-Disposition'] = str('attachment; filename=publishers_%s.csv' % (month,)) writer = csv.writer(response) writer.writerow(["Publisher", "Views", "Visits", "Period Name"]) @@ -183,6 +181,8 @@ packages = self._get_packages(c.publisher) response.headers['Content-Type'] = "text/csv; charset=utf-8" + response.headers['Content-Disposition'] = \ + str('attachment; filename=%s_%s.csv' % (c.publisher.name, month,)) writer = csv.writer(response) writer.writerow(["Publisher", "Views", "Visits", "Period Name"])