This doesn't seem to work :(
def comment_upvote(request, comment_id):
comment = get_object_or_404(Comment.objects.filter(id__exact=comment_id,
approved=True))
votes = request.session.setdefault('commentvotes', {})
if comment.id not in votes:
comment.upvotes = comment.upvote
On Thursday, 2 July 2015 19:09:59 UTC+1, jorr...@gmail.com wrote:
>
> Hi everyone,
>
> I am trying to keep track of who has voted on a comment by setting session
> variables like 'commentvote1', 'commentvote2', etc to True. These variable
> names are dynamically generated based on the id of the c
Hi everyone,
I am trying to keep track of who has voted on a comment by setting session
variables like 'commentvote1', 'commentvote2', etc to True. These variable
names are dynamically generated based on the id of the comment. How can I
access these dynamic variables in my template? I've tried
3 matches
Mail list logo