class ProductContainer(object):
    """
    container = ProductContainer()
    container[1]
    >>> <Product(1)>
    """

def __init__(self, request, name='product', parent=None):
    self.__name__ = name
self.__parent__ = parent
self._request = request

def __getitem__(self, key):
    p = db.get_product(id=key)
if not p:
    raise KeyError(key)
else:
    p.__acl__ = [(Allow, Everyone, 'view')]
p.__name__ = key
p.__parent__ = self
return p
Pyramid resource: In plain English