python - How to save result of the comparison with Django 'with' template tag? -


i create new variable in django template, have value of comparison obj.site.profile.default_role==obj

unfortunately none of these code doesn't work:

{% obj.site.profile.default_role==obj default %}{% endwith %}  {% default=obj.site.profile.default_role==obj %}{% endwith %} 

what proper syntax?

with tag have no support value evaluation.

the possible template-only solution can imaging split part of html sub-template , use {% include %} tag

{% if obj.site.profile.default_role==obj %}     {% include 'subtemplate.html' default=true %} {% else %}     {% include 'subtemplate.html' default=false %} {% endif %}  

Comments

Popular posts from this blog

gcc - MinGW's ld cannot perform PE operations on non PE output file -

How to connect android app to App engine -

hadoop - Running Map Reduce Job shows error - Mkdirs failed to create /var/folders/ -