Hi! In a project I get a set of images from a model, and then I display it on the template. In same template (but in another place), I just want to display first element of set, and number of objects given. Can I do it without adding those fields to views.py?
I've found a way for doing first, but it isn't very efficient: In views: images = tImage.objects.filter(product=product_id) In template: {% for image in images %} {% if forloop.first %} {{ image.image }} {% endif %} {% endfor %} Thanks a lot! Marc --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---