Improved testbed plugin to support facility_name and testbed_name filters
[myslice.git] / plugins / testbeds / __init__.py
1 from unfold.plugin import Plugin
2
3 class TestbedsPlugin(Plugin):
4     
5     def __init__ (self, query=None, **settings):
6         Plugin.__init__ (self, **settings)
7
8         # Until we have a proper way to access queries in Python
9         self.query              = query
10
11     def template_file (self):
12         return "testbeds.html"
13
14     def requirements (self):
15         reqs = {
16             'js_files' : [
17                 'js/testbeds.js'
18             ],
19 #            'css_files': [
20 #                'css/myplugin.css',
21 #            ]
22         }
23         return reqs
24
25     def json_settings_list (self):
26         # query_uuid will pass self.query results to the javascript
27         # and will be available as "record" in :
28         # on_new_record: function(record)
29         return ['plugin_uuid', 'domid', 'query_uuid']
30
31     def export_json_settings (self):
32         return True