it might be easiest to write a custom tag there {% vendor_of_product product forloop.counter %}
is product an array ? On Sep 30, 2:31 am, SnappyDjangoUser <[EMAIL PROTECTED]> wrote: > Hi Folks, > > How can I use a forloop counter to index into a query set as in the > example below? > > (I know this code does not work, but I want to do something of the > sort): > > {% for form in quote_product_formset.forms %} > <tr> > <td>{{ product.(forloop.counter).Vendor }}</td> > </tr> > > {{ form }} > {% endfor %} > > (in the above case, Vendor is a field in product. So if I want to > access the first product when forloop counter is 1, the variable would > expland to "{{ product.1.Vendor }}") > > Thanks! --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---