import uuid
from . import base
+from . import forms
from . import graphs
class TabsModule(base.BaseUIModule):
# List to store all items that have been added to this tab
self.items = []
- def add_graph(self, *args, **kwargs):
- graph = graphs.Graph(self.handler, *args, **kwargs)
- self.items.append(graph)
+ def _add_item(self, cls, *args, **kwargs):
+ item = cls(self.handler, *args, **kwargs)
+ self.items.append(item)
+
+ return item
- return graph
+ def add_form(self, *args, **kwargs):
+ return self._add_item(forms.Form, *args, **kwargs)
+
+ def add_graph(self, *args, **kwargs):
+ return self._add_item(graphs.Graph, *args, **kwargs)