Ejemplo n.º 1
0
 def myVote(self):
     if not self.canRate():
         return 0
     portal_state = getMultiAdapter((self.context, self.request),
                                    name='plone_portal_state')
     anonuid = None
     if portal_state.anonymous():
         anonuid = self.request.cookies.get(COOKIENAME, None)
     return rate.getMyVote(self.context, userid=anonuid)
Ejemplo n.º 2
0
 def myVote(self):
     if not self.canRate():
         return 0
     portal_state = getMultiAdapter((self.context, self.request),
                                    name='plone_portal_state')
     anonuid = None
     if portal_state.anonymous():
         anonuid = self.request.cookies.get(COOKIENAME, None)
     return rate.getMyVote(self.context, userid=anonuid)
Ejemplo n.º 3
0
    def myVote(self):
        if not self.canRate():
            return 0

        return rate.getMyVote(self.context)
Ejemplo n.º 4
0
 def __call__(self):
     self.update()
     myvote = rate.getMyVote(self.context)
     return myvote == -1