export all active fields in csv

This commit is contained in:
Frédéric Péters 2013-01-28 21:59:14 +01:00
parent 810adc2f96
commit 4fc096ac5a
1 changed files with 7 additions and 1 deletions

View File

@ -40,6 +40,12 @@ class FakeField:
# just here to quack like a duck
return None
def get_csv_heading(self):
return [self.label]
def get_csv_value(self, element):
return [element]
class FormResultDirectory(FormPage):
_q_exports = ['', 'csv', 'xls', 'participation', 'table', 'list']
@ -73,7 +79,7 @@ class FormResultDirectory(FormPage):
'<ul>'
' <li><a href="list%s">%s</a></li>' % (qs, _('List of results'))
' <li><a href="table%s">%s</a></li>' % (qs, _('Table of results'))
' <li><a href="csv">%s</a></li>' % _('CSV Export')
' <li><a href="csv%s">%s</a></li>' % (qs, _('CSV Export'))
if str(self.formdef.workflow_id).endswith(str('+anonymous')):
' <li><a href="participation">%s</a>' % _('Participation')
'</ul>'