diff --git a/vote/managers.py b/vote/managers.py index b843ee2..a79745e 100644 --- a/vote/managers.py +++ b/vote/managers.py @@ -154,9 +154,20 @@ def all(self, user_id, action=UP): return self.model.objects.filter(pk__in=list(object_ids)) - def count(self, action=UP): + def count_up(self): return self.through.votes_for(self.model, - self.instance, action).count() + self.instance, UP).count() + + def count_down(self): + return self.through.votes_for(self.model, + self.instance, DOWN).count() + + def count(self): + votes = { + "up": self.count_up(), + "down": self.count_down() + } + return votes def user_ids(self, action=UP): return self.through.votes_for(