from floof.lib.dbhelpers import find_or_create, update_or_create
class Rating(Entity):
- art = ManyToOne('Art', ondelete='cascade')
- rater = ManyToOne('User', ondelete='cascade')
- score = Field(Integer)
+ art = ManyToOne('Art', ondelete='cascade', required=True)
+ rater = ManyToOne('User', ondelete='cascade', required=True)
+ score = Field(Integer, required=True)
options = {-1:"sucks", 0:"undecided", 1:"good", 2:"great"}
default = 0
return rating.score
return Rating.default
-Art.__bases__ += (RatingMixin,)
\ No newline at end of file
+Art.__bases__ += (RatingMixin,)