I am working with a template in django trying to dispaly a specific number of random items from an array of related objects
for now i display all items in the array what changes can i make
{% for pdt in object.pdt_set.all %} <div class="ps-product ps-product--simple"> <div class="ps-product__thumbnail"> <a href="{% url 'pdtdetail' pdt.id %}"><img src="{{ pdt.image.ur }}"alt=""></a> <div class="ps-product__badge">-16%</div> <ul class="ps-product__actions"> <li><a href="#" data-toggle="tooltip" data-placement="top" title="Read More"><i class="icon-bag2"></i></a></li> <li><a href="#" data-placement="top" title="Quick View" data-toggle="modal" data-target="#product-quickview"><i class="icon-eye"></i></a></li> <li><a href="#" data-toggle="tooltip" data-placement="top" title="Add to Whishlist"><i class="icon-heart"></i></a></li> <li><a href="#" data-toggle="tooltip" data-placement="top" title="Compare"><i class="icon-chart-bars"></i></a></li> </ul> </div> <div class="ps-product__container"> <div class="ps-product__content" data-mh="garden"><a class="ps-product__title" href="product-default.html">{{ pdt.name }}</a> <div class="ps-product__rating"> <select class="ps-rating" data-read-only="true"> <option value="1">1</option> <option value="1">2</option> <option value="1">3</option> <option value="1">4</option> <option value="2">5</option> </select><span>01</span> </div> <p class="ps-product__price sale">$ {{ pdt.price }} </p> </div> </div> </div> {% endfor %}