Well, I want to compare two variables coming from a view in Django. I'm doing a for and iterating and comparing a value of type CharField (student.matricula) with another CharField (frequency.matricula)! I wondered if you could do that. My result always falls on the else!
<table>
<tr>
<td>Turma</td>
<td>Matrícula</td>
<td>Nome</td>
<td>Faltas</td>
<td>Data com hora</td>
</tr>
{% for aluno in alunos_tsi %}
<tr>
<td>TSI</td>
<td>{{ aluno.matricula }}</td>
<td>{{ aluno.nome }}</td>
{% for frequencia in frequencias %}
{% if frequencia.matricula == aluno.matricula %}
<td>{{ frequencia.faltas }}</td>
<td>{{ frequencia.data_com_hora }}</td>
{% else %}
<td>0</td>
<td>Nenhuma frequência registrada</td>
{% endif %}
{% endfor %}
</td>
</tr>
{% endfor %}
</table>