7
I have a Django application where in the template I need to validate a file extension coming from filefield.
<div class="row">
<p class="anexos">
{% trans 'Anexos' %}
</p>
#if .jpg .png
<div class="col-sm-3 col-md-2">
<img class="img-thumbnail" src="{[{ anexo.trajeto }]}"/>
</div>
#elif .mp4 .avi
<div class="col-sm-3 col-md-2">
<img class="video-thumbnail" src="{[{ anexo.trajeto }]}"/>
</div>
#elif .zip
<a href="{[{ anexo.trajeto }]}">Arquivo Compactado</a>
#endif
</div>
How do I solve this problem?
That one
{[{ anexo.trajeto }]}
that’s the way it is, or it would be{{ anexo.trajeto }}
? I’ve never seen this syntax before, if it’s right, what it does?– mgibsonbr