Re: forloop variables without for

2007-07-19 Thread sean
Glad to help. {{ images.image_set.count }} or similar should work, depending on your models. cheers, Sean On Jul 20, 1:13 am, Marc Garcia <[EMAIL PROTECTED]> wrote: > Thanks mate, it works great. > > Anybody could tell me if there is something like that for counting > items on that? > > Don't

Re: forloop variables without for

2007-07-19 Thread Marc Garcia
Thanks mate, it works great. Anybody could tell me if there is something like that for counting items on that? Don't want to do: {% for image in images %} {% if forloop.last %} {{ forloop.counter }} {% endif %} {% endfor %} On Jul 19, 7:51 pm, sean <[EMAIL

Re: forloop variables without for

2007-07-19 Thread sean
Try {{ images.0.image }} Sean On Jul 19, 7:43 pm, Marc Garcia <[EMAIL PROTECTED]> wrote: > 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

forloop variables without for

2007-07-19 Thread Marc Garcia
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,