Reputation: 34170
All,
Can t we do the following in templates
{% if subject.id == selected_id %}
and also cannot we assign variable like {{selected="selected"}}
Thank........
Upvotes: 1
Views: 3090
Reputation: 816472
This comparison will work in Django 1.2. For 1.1 you have to use ifequal:
{% ifequal subject.id selected_id %}
For variable assignment you can use with.
{% with selected as 'selected' %}
{% endwith %}
Don't hesitate to read the documentation, it doesn't hurt.
Upvotes: 4
Reputation: 798726
Not as shown. Use the ifequal
and with
template tags instead.
Upvotes: 0