Example #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)
Example #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)
Example #3
0
    def myVote(self):
        if not self.canRate():
            return 0

        return rate.getMyVote(self.context)
 def __call__(self):
     self.update()
     myvote = rate.getMyVote(self.context)
     return myvote == -1