仍然有问题,我看到了其他帖子。和这里的帖子:
https://docs.djangoproject.com/el/1.11/topics/auth/default/#authentication-data-in-templates
所以我正在这样做:
{% for trn in trainee %}
<tr>
<td>{{ trn.first_name }} {{ trn.last_name }}</td>
<td>{{ trn.institution }}</td>
<td>{{ trn.contact_phone }}</td>
<td>{{ trn.contact_email }}</td>
<td>{{ trn.trained_date }}</td>
{% if perms.django_apo.training.delete_trainee %}
<td> BUTTON </td>
{% else %}
<td> NA </td>
{% endif %}
</tr>
{% endfor %}
但是,它每次都带有NA。我想念什么?