[web/views] Allow changing CSVView's separator (closes #5227442)
authorRémi Cardona <remi.cardona@logilab.fr>
Wed, 01 Apr 2015 15:06:45 +0200
changeset 10300 bfe33b5710d1
parent 10299 4f3b6dad5084
child 10326 03d98646d57c
[web/views] Allow changing CSVView's separator (closes #5227442)
web/views/baseviews.py
--- a/web/views/baseviews.py	Thu Apr 16 18:59:12 2015 +0200
+++ b/web/views/baseviews.py	Wed Apr 01 15:06:45 2015 +0200
@@ -422,6 +422,7 @@
     """
     __regid__ = 'csv'
     redirect_vid = 'incontext'
+    separator = u', '
 
     def call(self, subvid=None, **kwargs):
         kwargs['vid'] = subvid
@@ -429,7 +430,7 @@
         for i in xrange(len(rset)):
             self.cell_call(i, 0, **kwargs)
             if i < rset.rowcount-1:
-                self.w(u", ")
+                self.w(self.separator)
 
 
 # XXX to be documented views ###################################################