'Return the traffic data in CSV format for reports.'

def as_csv(self):

    import csv
    import cStringIO
    out = cStringIO.StringIO()
    writer = csv.writer(out)
    writer.writerow((_('subreddit'), _('uniques'), _('pageviews')))
    for ((name, url), (uniques, pageviews)) in self.report:
        writer.writerow((name, uniques, pageviews))
    return out.getvalue()
