Python Django模板语言中是否有isfile()或isdir()的等价物?

Python Django模板语言中是否有isfile()或isdir()的等价物?,python,django,Python,Django,我想达到这样的目标 {% for file in fileList %} {% if file isfile %} <a href="{% url 'GA:download' file %}">{{file}}</a><br> {% endif %} {% endfor %} 你能行 {% for file in fileList %} {% if file.media %}

我想达到这样的目标

{% for file in fileList %}
        {% if file isfile %}
             <a href="{% url 'GA:download' file %}">{{file}}</a><br>
        {% endif %}
{% endfor %}
你能行

{% for file in fileList %}
        {% if file.media %}
             <a href="{% url 'GA:download' file %}">{{file}}</a><br>
        {% endif %}
{% endfor %}
{%for fileList%中的文件]
{%if file.media%}

{%endif%} {%endfor%}
上个月它工作得很好,但现在不行了。你能详细说明一下
.media
是什么,这样我就可以解决这个问题了吗?
{% for file in fileList %}
        {% if file.media %}
             <a href="{% url 'GA:download' file %}">{{file}}</a><br>
        {% endif %}
{% endfor %}