예제 #1
0
 def ratings_range(self):
     r = [{'rate': i + 1,
           'active': self.ratings > i} for i in xrange(Rating.length())]
     return r
예제 #2
0
 def user_votes_range(self, user):
     vote = self.user_votes(user)
     rate = vote.rate if vote else 0
     r = [{'rate': i + 1,
           'active': rate > i} for i in xrange(Rating.length())]
     return r