fnp
/
edumed.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
9616d8f
)
csv export: support for bools and lists
author
Jan Szejko
<jan.szejko@gmail.com>
Mon, 9 May 2016 14:43:29 +0000
(16:43 +0200)
committer
Jan Szejko
<jan.szejko@gmail.com>
Mon, 9 May 2016 14:43:29 +0000
(16:43 +0200)
contact/admin.py
patch
|
blob
|
history
diff --git
a/contact/admin.py
b/contact/admin.py
index
7581666
..
0a0aaa0
100644
(file)
--- a/
contact/admin.py
+++ b/
contact/admin.py
@@
-157,6
+157,11
@@
def extract_view(request, form_tag, extract_type_slug):
for key in keys:
if key not in record:
record[key] = ''
for key in keys:
if key not in record:
record[key] = ''
+ if isinstance(record[key], bool):
+ record[key] = 'tak' if record[key] else 'nie'
+ if isinstance(record[key], (list, tuple)):
+ record[key] = '; '.join(record[key])
+
csv_writer.writerow([record[key] for key in keys])
csv_writer.writerow([])
csv_writer.writerow([record[key] for key in keys])
csv_writer.writerow([])