shellfly / django-vote

Simple vote for django
http://django-vote.readthedocs.io
Apache License 2.0
158 stars 49 forks source link

Issue 71: separated count votes functions #72

Open edegeyer opened 4 years ago

edegeyer commented 4 years ago

71 implementation of the suggested changes

shellfly commented 4 years ago

@edegeyer The changes break backward compatibility and also introduce duplicate code. I would like to do it like this:

def count_up(self):
    return self.count(self, UP)
def count_down(self):
    return self.count(self, DOWN)

Also, at first this project doesn't support down vote, that's why the default counts up actions. The README is not updated, do you think mention it in document is better than add two extra methods?

edegeyer commented 4 years ago

Mentioning this in the README would definitely help, because for example I wasn't aware about it, as the action "DOWN" occurs and Downvotes can be stored/made. For me personally, it would be more useful, if Downvoting is fully supported and would be happy to help with the steps towards a full support of that function

shellfly commented 4 years ago

@edegeyer There are two fields num_vote_up and num_vote_down added when implementing down vote. They can be used to replace the count api now. If you're willing to update the PR to improve the README, that would be great.