shellfly / django-vote

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

Is there an option to clear all existing votes? #53

Open CuriousLearner opened 7 years ago

CuriousLearner commented 7 years ago

I tried reseting all the votes count in my inherited model by updating the num_vote_up, num_vote_down and vote_score.

I can iterate over all the instances via vote manager and remove the votes. But I want to avoid that.

Is there a simpler way I can clear all existing votes from the vote table as well or that is the only way and I need to do that asynchronously?

shellfly commented 7 years ago

No method for this now, The all method get a queryset of all votes by a user, you can use the code in this method and remove the user argument. https://github.com/shanbay/django-vote/blob/master/vote/managers.py#L147