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

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -