SyrusAkbary/pyjade — pull request #60 by christophercurrie (2013-01-10 20:33:58+00:00)
Title: Add support for Jade's loop index iteration syntax.

Per [the jade docs](https://github.com/visionmedia/jade#a9), jade should support iterating over the index variable of a list:

> iterating an array with index:
>
> ```jade
> items = ["one", "two", "three"]
> each item, i in items
> li #{item}: #{i}
> ```
> outputs:
>
> ```html
>
one: 0

>
two: 1

>
three: 2

> ```

This patch adds this support to PyJade for all supported template languages.

It does introduce one potentially backwards-incompatible change: in some cases, loop iteration may have implicitly taken advantage of Django's automatic nested loop unpacking, which should no longer occur under this patch.

It also makes explicit the fact that jade only supports up to two variables as loop keys, by throwing an exception if more than two keys are provided.