1 from engine.plugin import Plugin
3 class SimpleList (Plugin) :
5 # it would make sense to *not* define any constructor here and let Plugin kick in
6 # however it feels nicer this way as we document the settings used in our own template
7 # plus it's less confusing for any subclass if they can be sure which constructor to call
8 def __init__ (self, list=[], with_datatables=False, **settings):
9 Plugin.__init__ (self, **settings)
11 # don't expose this as it's big and
12 self.add_to_settings ('list')
13 self.with_datatables = with_datatables
14 self.add_to_settings ('with_datatables')
16 # SimpleList is useless per se anyways
17 def template_file (self): return "simplelist.html"
19 def requirements (self):
20 reqs = { 'js_files' : [ "js/simplelist.js" ],
21 'css_files': [ "css/simplelist.css" ],
23 if self.with_datatables:
24 reqs['js_files'].append ("datatables/js/dataTables.js")
25 reqs['js_files'].append ("js/with-datatables.js")
28 # 'js_chunks' : "/* a javascript chunk */",
29 # 'css_chunks': "/* a css style */ ",
31 def exclude_from_json (self):