1๐
โ
You can achieve by using either with
tag to set a variable or direclty us as:
{% with skus=i.skus.first %}
<h6 class="card-price">{{skus.price}} {{skus.currency}}</h6
{% endwith %}
or
<h6 class="card-price">{{i.skus.first.price}} {{i.skus.first.currency}}</h6
๐คshah sawood
0๐
You may be looking for the first
queryset method:
<div class="card-body">
<img src={{i.images.first().img_url}} class="card-img-top" alt="...">
</div>
๐คNicolas Appriou
- [Answered ]-How to concatenate double curly brackets with variables in javascript
- [Answered ]-How to crop an image selected with django-filer in django admin
- [Answered ]-Exclude object if object is private
- [Answered ]-Auto update cache in Django
- [Answered ]-Django add select2
Source:stackexchange.com