X-Git-Url: http://git.veekun.com/zzz-floof.git/blobdiff_plain/da9dc9c1a060be8de3c13fa308a047b4b57eaaeb..42398bc94b95b5a115396f14c3c1dde6fb6808a5:/floof/model/ratings.py diff --git a/floof/model/ratings.py b/floof/model/ratings.py index 6b5850a..ab850b1 100644 --- a/floof/model/ratings.py +++ b/floof/model/ratings.py @@ -3,9 +3,9 @@ from art import Art 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 @@ -23,4 +23,4 @@ class RatingMixin(object): return rating.score return Rating.default -Art.__bases__ += (RatingMixin,) \ No newline at end of file +Art.__bases__ += (RatingMixin,)