I have a nested if statement in a template:;
{% if object in request.user.mymodel_set.all %}
{% if object.pk == request.session.field_pk %}
Selected
{% else %}
<form method="POST" action="myURL" class="">
{% csrf_token %}
<input type="submit" value="Select">
</form>
{% endif %}
{% endif %}
However the <input> does not render. It does when the parent {% if %} statement is removed. Am I missing something as to how the else statement is handled in this template?
object in request.user.mymodel_set.allisTrue?