示例#1
0
    def __getitem__(self, name):
        resource = self.context.get(name)

        if resource is None:
            raise KeyError(name)

        if IBannerPlace.providedBy(resource):
            return Banners(self, resource, self.request)
        else:
            return BannerWrapper(resource, self.request)
示例#2
0
 def browserDefault(self, request):
     if IBannerPlace.providedBy(self.context):
         return getattr(
             BannerWrapper(self.select(), self.request), request.method), ()
     return empty, ()