src/pyams_skin/container.py
changeset 0 bb4aabe07487
child 62 95b8b181c3ad
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/container.py	Thu Feb 19 10:59:00 2015 +0100
@@ -0,0 +1,41 @@
+#
+# Copyright (c) 2008-2015 Thierry Florac <tflorac AT ulthar.net>
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+
+__docformat__ = 'restructuredtext'
+
+
+# import standard library
+
+# import interfaces
+from pyams_skin.interfaces.container import IContainerBaseView
+from pyams_skin.layer import IPyAMSLayer
+
+# import packages
+from pyams_skin.table import BaseTable
+from pyams_template.template import template_config
+from zope.interface import implementer
+
+
+@template_config(template='templates/container.pt', layer=IPyAMSLayer)
+@implementer(IContainerBaseView)
+class ContainerView(object):
+    """Base container view"""
+
+    table_class = BaseTable
+
+    def __init__(self, context, request):
+        super(ContainerView, self).__init__(context, request)
+        self.table = self.table_class(context, request)
+
+    def update(self):
+        super(ContainerView, self).update()
+        self.table.update()