for line in context['object_list']:
if line.filepath.track:
writer.writerow([line.play_timestamp.strftime('%Y-%m-%d %H:%M'),
- line.filepath.short.encode('utf-8', 'replace'),
- line.filepath.track.title.encode('utf-8', 'replace'),
- line.filepath.track.artist.name.encode('utf-8', 'replace'),
+ line.filepath.short,
+ line.filepath.track.title,
+ line.filepath.track.artist.name,
line.filepath.track.language,
line.filepath.track.instru and 'instru' or '',
line.filepath.track.cfwb and 'cfwb' or '',
])
else:
writer.writerow([line.play_timestamp.strftime('%Y-%m-%d %H:%M'),
- line.filepath.short.encode('utf-8', 'replace')])
+ line.filepath.short])
return HttpResponse(out.getvalue(), content_type='text/csv; charset=utf-8')
writer.writerow(['Title', 'Artist', 'Zones', 'Language', 'Instru', 'CFWB', 'Ajout'])
for track in self.get_queryset():
writer.writerow([
- track.title.encode('utf-8', 'replace') if track.title else 'Inconnu',
- track.artist.name.encode('utf-8', 'replace') if (track.artist and track.artist.name) else 'Inconnu',
- ' + '.join([x.title.encode('utf-8') for x in track.nonstop_zones.all()]),
+ track.title if track.title else 'Inconnu',
+ track.artist.name if (track.artist and track.artist.name) else 'Inconnu',
+ ' + '.join([x.title for x in track.nonstop_zones.all()]),
track.language or '',
track.instru and 'instru' or '',
track.cfwb and 'cfwb' or '',