diff options
author | holyantony | 2015-07-14 16:45:10 +0530 |
---|---|---|
committer | holyantony | 2015-07-14 16:45:10 +0530 |
commit | 8346482d47f98be745466087b0bd5dc954f46cf4 (patch) | |
tree | fd77e12607bbeb4d3bdd60bed20023a52fac245b /website/models.py | |
parent | a2059ac649fbbd14c97e6a15c129e672616077b0 (diff) | |
download | FOSSEE-Forum-8346482d47f98be745466087b0bd5dc954f46cf4.tar.gz FOSSEE-Forum-8346482d47f98be745466087b0bd5dc954f46cf4.tar.bz2 FOSSEE-Forum-8346482d47f98be745466087b0bd5dc954f46cf4.zip |
Subject: Voting Validation(Questions)
Description:
1. User cannot vote his/her own question
Diffstat (limited to 'website/models.py')
-rw-r--r-- | website/models.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/website/models.py b/website/models.py index b15f1cd..b195f3f 100644 --- a/website/models.py +++ b/website/models.py @@ -31,8 +31,12 @@ class Question(models.Model): userUpVotes = models.ManyToManyField(User, blank=True, related_name='postUpVotes') userDownVotes = models.ManyToManyField(User, blank=True, related_name='postDownVotes') num_votes = models.IntegerField(default=0) + + def __unicode__(self): return '%s' % (self.user) + + class Meta: get_latest_by = "date_created" |