src/pyams_skin/container.py
changeset 0 bb4aabe07487
child 62 95b8b181c3ad
equal deleted inserted replaced
-1:000000000000 0:bb4aabe07487
       
     1 #
       
     2 # Copyright (c) 2008-2015 Thierry Florac <tflorac AT ulthar.net>
       
     3 # All Rights Reserved.
       
     4 #
       
     5 # This software is subject to the provisions of the Zope Public License,
       
     6 # Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
       
     7 # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
       
     8 # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
       
     9 # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
       
    10 # FOR A PARTICULAR PURPOSE.
       
    11 #
       
    12 
       
    13 __docformat__ = 'restructuredtext'
       
    14 
       
    15 
       
    16 # import standard library
       
    17 
       
    18 # import interfaces
       
    19 from pyams_skin.interfaces.container import IContainerBaseView
       
    20 from pyams_skin.layer import IPyAMSLayer
       
    21 
       
    22 # import packages
       
    23 from pyams_skin.table import BaseTable
       
    24 from pyams_template.template import template_config
       
    25 from zope.interface import implementer
       
    26 
       
    27 
       
    28 @template_config(template='templates/container.pt', layer=IPyAMSLayer)
       
    29 @implementer(IContainerBaseView)
       
    30 class ContainerView(object):
       
    31     """Base container view"""
       
    32 
       
    33     table_class = BaseTable
       
    34 
       
    35     def __init__(self, context, request):
       
    36         super(ContainerView, self).__init__(context, request)
       
    37         self.table = self.table_class(context, request)
       
    38 
       
    39     def update(self):
       
    40         super(ContainerView, self).update()
       
    41         self.table.update()