-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathhtmldatafilter.py
29 lines (23 loc) · 960 Bytes
/
htmldatafilter.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# -*- coding: utf-8 -*-
import datafilter
#For Security control and init
from AccessControl import ClassSecurityInfo
import Globals
class HTMLDataFilter(datafilter.DataFilter):
"HTMLDataFilter apply this to an a list of dicts to make it output a table"
meta_type = "HTMLDataFilter"
security = ClassSecurityInfo()
security.declareProtected('View', 'view')
def view(self, archive=None, order=None, start=None, stop=None, header=1, query=None, merge=None):
"Inline draw view"
if order is None:
order = self.getFieldOrder()
records = self.getDataRecords(order, archive=archive, start=start, stop=stop, header=header, query=query, merge=merge)
output = self.createTable(records)
if output:
return output
else:
return '<p>No Drawable Data Found</p>'
Globals.InitializeClass(HTMLDataFilter)
import register
register.registerClass(HTMLDataFilter)