Mercurial > public > sg101
comparison downloads/management/commands/dlcatreport.py @ 874:b59c154d0163
For some reason, don't need to encode output anymore.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Thu, 25 Dec 2014 17:20:28 -0600 |
parents | 161b56849114 |
children | cb712b2c34af |
comparison
equal
deleted
inserted
replaced
867:21946dc3662d | 874:b59c154d0163 |
---|---|
43 report = render_to_string('downloads/commands/category_report.html', { | 43 report = render_to_string('downloads/commands/category_report.html', { |
44 'category': category, | 44 'category': category, |
45 'downloads': downloads, | 45 'downloads': downloads, |
46 }) | 46 }) |
47 | 47 |
48 # encode it ourselves since it can fail if you try to redirect output to | 48 self.stdout.write(report) |
49 # a file and any of the content is not ASCII... | |
50 self.stdout.write(report.encode('utf-8')) | |
51 | 49 |
52 def print_titles(self, dls): | 50 def print_titles(self, dls): |
53 """Print out the download titles""" | 51 """Print out the download titles""" |
54 | 52 |
55 for dl in dls: | 53 for dl in dls: |
56 self.stdout.write(dl.title.encode('utf-8')) | 54 self.stdout.write(dl.title) |
57 | 55 |
58 | 56 |