示例#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