Added "get_context" class method
authorThierry Florac <thierry.florac@onf.fr>
Thu, 14 Jun 2018 10:34:58 +0200
changeset 345 fd8621930779
parent 344 f1dc3da37393
child 346 e6fb4dbdda28
Added "get_context" class method
src/pyams_skin/table.py
--- a/src/pyams_skin/table.py	Thu Jun 14 08:58:56 2018 +0200
+++ b/src/pyams_skin/table.py	Thu Jun 14 10:34:58 2018 +0200
@@ -80,6 +80,9 @@
 class BaseTable(Table):
     """Custom table"""
 
+    def __init__(self, context, request):
+        super(BaseTable, self).__init__(self.get_context(context), request)
+
     @reify
     def id(self):
         return get_table_id(self, self.context)
@@ -91,6 +94,10 @@
 
     cssClasses = {'table': 'table table-bordered table-striped table-hover table-tight datatable'}
 
+    @classmethod
+    def get_context(cls, context):
+        return context
+
     @property
     def data_attributes(self):
         return {