Пример #1
0
 def talks(self):
     portal_catalog = getToolByName(self.context, 'portal_catalog')
     talks = portal_catalog(portal_type="talk",
                            path="/".join(self.context.getPhysicalPath()))
     for brain in talks:
         # Achtung, wir wecken Objekte auf, das kann teuer sein.
         talk = brain.getObject()
         voting = IVoting(talk)
         yield {
             # Was passiert bei brain.title?
             # talk.title
             'title': brain.Title,
             # talk.absolute_url()
             'absolute_url': brain.getURL(),
             'average_rating': voting.average_vote(),
             'audience': talk.audience,
             'uuid': brain.UID,
             }
Пример #2
0
 def render(self):
     voting = IVoting(self.context)
     voting.clear()
     return "success"
Пример #3
0
 def render(self, rating):
     voting = IVoting(self.context)
     voting.vote(rating, self.request)
     return "success"
Пример #4
0
 def render(self):
     voting = IVoting(self.context)
     voting.clear()
     return "success"
Пример #5
0
 def render(self, rating):
     voting = IVoting(self.context)
     voting.vote(rating, self.request)
     return "success"