honestly i think forloop.counter is what you need to use.

when you say it doesn't work, what do you mean?  you do realize this
variable starts at '1' not '0' ?


2008/3/24, [EMAIL PROTECTED] <[EMAIL PROTECTED]>:
>
>
> This seems to work fine for me: http://dpaste.com/41059/
>
> On Mar 24, 2:29 pm, Tim Sawyer <[EMAIL PROTECTED]> wrote:
> > On Monday 24 Mar 2008, James Bennett wrote:
> >
> > > The first thing to do is to step back and remember that the Django
> > > template language is not Python
> >
> > I know that - writing it as python code was the quickest way to get
> across
> > what I wanted! :-)
> >
> > > The second thing to do is to read the template documentation to see
> > > what is available, because doing so will turn up things like this:
> >
> > >http://www.djangoproject.com/documentation/templates/#divisibleby
> >
> > I saw that, but I couldn't work out how to conditionally output html
> based on
> > its value.  {% if forloop.counter|divisibleby: "4" %} doesn't work.
> >
> > On Monday 24 Mar 2008, Michael Wieher wrote:
> >
> > > Can you simulate it with an incremental variable?
> >
> > Sorry, I don't know what you mean.  Can you explain more or give me a
> quick
> > example?
> >
> > Thanks,
> >
> > Tim.
> >
>

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to