From 30574b902abfedf033f7c71e65f8152a53b5cccc Mon Sep 17 00:00:00 2001 From: Jan Szejko Date: Mon, 9 May 2016 16:43:29 +0200 Subject: [PATCH] csv export: support for bools and lists --- contact/admin.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/contact/admin.py b/contact/admin.py index 7581666..0a0aaa0 100644 --- 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] = '' + 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([]) -- 2.20.1