Re: how to show image with index in python as context variable

2017-04-26 Thread Dartos
Hi, If you're using the django template language, use a dot instead of []. Try this: {{ item.0.image.url }} For {{ foo.bar }}, the django template language tries the following: foo[bar]# dict lookup foo.bar# property foo[int(bar)]# index lookup foo.bar()# callable Reference for

how to show image with index in python as context variable

2017-04-25 Thread Shamaila Moazzam
hi, i am trying to display a set of images with the use of index. here is the code: {% for item in product.productimage_set.all %} {% endfor %} the above code is displaying a set of images for one product .right. i want to displa