Reified table ID property
authorThierry Florac <thierry.florac@onf.fr>
Wed, 23 May 2018 15:18:07 +0200
changeset 323 391f772a2e6d
parent 322 fde93ea7a59a
child 324 49c7deef8eef
Reified table ID property
src/pyams_skin/table.py
--- a/src/pyams_skin/table.py	Wed May 23 15:16:25 2018 +0200
+++ b/src/pyams_skin/table.py	Wed May 23 15:18:07 2018 +0200
@@ -29,6 +29,7 @@
 from pyams_utils.adapter import ContextRequestViewAdapter, adapter_config
 from pyams_utils.url import absolute_url
 from pyams_viewlet.viewlet import Viewlet
+from pyramid.decorator import reify
 from pyramid.url import resource_url
 from z3c.table.column import Column, GetAttrColumn
 from z3c.table.table import Table
@@ -78,7 +79,7 @@
 class BaseTable(Table):
     """Custom table"""
 
-    @property
+    @reify
     def id(self):
         return get_table_id(self, self.context)