Re: Access dynamic session variable name in template

2015-07-02 Thread jorrit787
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

Re: Access dynamic session variable name in template

2015-07-02 Thread Daniel Roseman
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

Access dynamic session variable name in template

2015-07-02 Thread jorrit787
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