Source

django-poll-system / poll / models.py

Diff from to

poll/models.py

                     raise ValidationError(err_msg)
 
     def get_vote_count(self):
-        return Vote.objects.filter(poll=self).count()
+        return self.vote_set.count()
 
     vote_count = property(fget=get_vote_count)
 
                                      verbose_name=_('Position'),
                                      help_text=_('Its for positioning only'))
 
+    def get_vote_count(self):
+        return self.choice_set.count()
+
+    vote_count = property(fget=get_vote_count)
+
     def __unicode__(self):
         return u'%s (%d)' % (self.value, self.index)