From: Guillaume Pellerin Date: Fri, 13 Nov 2015 15:30:50 +0000 (+0100) Subject: csv: tags of the first element X-Git-Tag: 1.6b~7^2~53 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=7fabfba2e3599ac0d4f64f3a3117ec49de0b1189;p=telemeta.git csv: tags of the first element --- diff --git a/telemeta/util/unicode.py b/telemeta/util/unicode.py index 152a9fad..01d12d4f 100644 --- a/telemeta/util/unicode.py +++ b/telemeta/util/unicode.py @@ -73,10 +73,10 @@ class CSVExport(object): def write(self, elements): tags = [] element_dicts = [e.to_dict_with_more() for e in elements] - for e in element_dicts: - for key in e.keys(): - if not key in tags: - tags.append(key) + e = element_dicts[0] + for key in e.keys(): + if not key in tags: + tags.append(key) # code and title on the two first column tags.remove('code') tags.remove('title')