django - Template tag if -
i 2 var:
post = post.objects.get(pk=post_id) rated = rated.objects.filter(username=request.user,rated=true) by django-mptt magic post.comment_root.get_descendants transformed node.
in template try use:
{% if node in rated %} x {% else %} y {% endif %} , y. why?
p.s.: sorry english
my guess post.comment_root.get_descendants nets queryset of comments. comment never in queryset of rated, because they're different types. need compare apples apples.
Comments
Post a Comment