模板.html
在 django 中是否可以像这样检查条件,我在这一行中遇到错误(incident.other_location 或 location)。
{%if newreport_tab and reportperson and incident.manual_date and media and followup and (incident.other_location or location) and incident.other_incident_type and types%}<a href="{% url incident.views.savereport %}">{% include "buttons/saveandclose.html" %}</a>{%else%}{% include "buttons/saveandclose.html" %}{%endif%}
我收到此错误
"TemplateSyntaxError at /report/savereport/
Could not parse the remainder: '(incident.other_location' from 'and(incident.other_location'"