An actual minimum viable product, maybe? #11

Merged
andrewlalis merged 43 commits from develop into master 2018-10-12 18:19:41 +00:00
1 changed files with 2 additions and 2 deletions
Showing only changes of commit 57ad0f20e0 - Show all commits

View File

@ -63,11 +63,11 @@ class Review(models.Model):
# Gets the total number of votes which marked this review as 'helpful'. # Gets the total number of votes which marked this review as 'helpful'.
def getHelpfulVoteCount(self): def getHelpfulVoteCount(self):
ReviewHelpfulVote.objects.filter(pk=self.pk, helpful=True).count() return ReviewHelpfulVote.objects.filter(pk=self.pk, helpful=True).count()
# Gets the total number of votes which marked this review as 'unhelpful'. # Gets the total number of votes which marked this review as 'unhelpful'.
def getUnhelpfulVoteCount(self): def getUnhelpfulVoteCount(self):
ReviewHelpfulVote.objects.filter(pk=self.pk, helpful=False).count() return ReviewHelpfulVote.objects.filter(pk=self.pk, helpful=False).count()
# A vote for a review as either positive or negative. # A vote for a review as either positive or negative.
class ReviewHelpfulVote(models.Model): class ReviewHelpfulVote(models.Model):