Ejemplo n.º 1
0
    def query_contents(self, **contentFilter):
        if self.__folder_restrict__:
            contentFilter['object_provides'] = [
                ".".join((iface.__module__, iface.__name__))
                for iface in self.__folder_restrict__
                ]

        handler = IContentQueryHandler(self.context, None)
        return handler and handler.query_contents(
            limit = self.__folder_limit__, **contentFilter
            ) or []
Ejemplo n.º 2
0
 def results(self):
     """Get the actual result brains from the collection.
     It will limit the actual selection to photos.
     """
     results = []
     source = self.source
     iface = "Products.ATContentTypes.interface.image.IPhotoAlbumAble"
     if source is not None:
         contentFilter = dict(object_provides = iface)
         handler = IContentQueryHandler(source, None)
         results = handler and handler.query_contents(contentFilter) or []
     return results
Ejemplo n.º 3
0
 def _contents(self):
     contentFilter = {"object_provides":
                      'sd.contents.interfaces.base.IStructuredItem'}
     handler = IContentQueryHandler(self.context)
     brains = handler and handler.query_contents(**contentFilter) or []
     return [brain.getObject() for brain in brains]