lingo: give csv text rows in python 3
This commit is contained in:
parent
5b87381487
commit
3882075071
|
@ -20,6 +20,7 @@ from dateutil import parser as date_parser
|
|||
|
||||
from django.core.urlresolvers import reverse_lazy
|
||||
from django.db.models import Q
|
||||
from django.utils import six
|
||||
from django.utils.timezone import make_aware
|
||||
from django.views.generic import (CreateView, UpdateView, ListView,
|
||||
DeleteView, TemplateView)
|
||||
|
@ -93,7 +94,10 @@ def download_transactions_csv(request):
|
|||
str(transaction.amount)]
|
||||
for item in transaction.items.all():
|
||||
row.extend([item.subject, str(item.amount)])
|
||||
writer.writerow([unicode(x).encode('utf-8') for x in row])
|
||||
if six.PY3:
|
||||
writer.writerow([x for x in row])
|
||||
else:
|
||||
writer.writerow([unicode(x).encode('utf-8') for x in row])
|
||||
return response
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue