Closed tigrettin closed 6 years ago
You have to pass user_id
instead of a user
instance. We should raise an error here.
I changed that line as review.votes.up(request.user.id)
but still can't register the vote. Is the rest OK?
You can add some print
to your view and check if the votes.up
have been executed.
Yes, I've got {{ review.votes.count }}
in my template and it shows "0", I can't execute upvoting through my view. But it works in the shell.
I'm pretty new to Django and struggling to implement django-vote to my app.
For voting up a review in my Car page, I tried this in my template:
My URL:
My view function:
But this doesn't register the vote, and it doesn't redirect me back to the Car page.
Could you give me a simple template implementation and view function example of voting up, or clarify my errors?
Any suggestion or feedback will be welcomed and greatly appreciated.
Thank you.