Ejemplo n.º 1
0
    def videos(self):

        target = self.target()

        if target is None:
            return []

        view = queryMultiAdapter((target, self.request), name=u"flowplayer")
        if view is None or not IFlowPlayerView.providedBy(view):
            return []

        videos = view.videos()

        limit = self.data.limit
        if limit:
            result = videos[:limit]
        else:
            result = videos

        if self.data.random:
            random.shuffle(result)
        return result
Ejemplo n.º 2
0
    def videos(self):

        target = self.target()

        if target is None:
            return []

        view = queryMultiAdapter((target, self.request), name=u"flowplayer")
        if view is None or not IFlowPlayerView.providedBy(view):
            return []

        videos = view.videos()

        limit = self.data.limit
        if limit:
            result = videos[:limit]
        else:
            result = videos

        if self.data.random:
            random.shuffle(result)
        return result
Ejemplo n.º 3
0
 def scale(self):
     target = self.target()
     view = queryMultiAdapter((target, self.request), name=u"flowplayer")
     if view is None or not IFlowPlayerView.providedBy(view):
         return False
     return view.scale()
Ejemplo n.º 4
0
 def scale(self):
     target = self.target()
     view = queryMultiAdapter((target, self.request), name=u"flowplayer")
     if view is None or not IFlowPlayerView.providedBy(view):
         return False
     return view.scale()