Beispiel #1
0
 def _getOrCreateVote(self, pointRootKey):
     vote = UserVote.query(UserVote.pointRootKey == pointRootKey,
                           ancestor=self.key).get()
     if not vote:  # No vote yet, create a new one
         vote = UserVote(pointRootKey=pointRootKey,
                         value=0,
                         ribbon=False,
                         parent=self.key)
     return vote