Re: suggestion for a slightly extended {% for ... in ... %} tag

2007-02-18 Thread Honza Král
On 2/18/07, SmileyChris <[EMAIL PROTECTED]> wrote: > > > > On Feb 18, 10:10 pm, "Arnaud Delobelle" <[EMAIL PROTECTED]> > wrote: > > > However - I acknowledge the use case: Two lists, n items long, that > > > are from independent sources. I think a separate template tag in the > > > same vein as {%

Re: suggestion for a slightly extended {% for ... in ... %} tag

2007-02-18 Thread SmileyChris
On Feb 18, 10:10 pm, "Arnaud Delobelle" <[EMAIL PROTECTED]> wrote: > > However - I acknowledge the use case: Two lists, n items long, that > > are from independent sources. I think a separate template tag in the > > same vein as {% regroup %} would be a better approach. > > > {% zip lista list

Re: suggestion for a slightly extended {% for ... in ... %} tag

2007-02-18 Thread Arnaud Delobelle
On Feb 18, 6:54 am, "Russell Keith-Magee" <[EMAIL PROTECTED]> wrote: [...] > > > Also (maybe more contentious): > > > {% for i in L1,L2 %} meaning what one would write in python as: > > > for i in zip(L1,L2) > > Most people seem to be +0 on this, but I'm very much -1. > > Firstly, the proposed

Re: suggestion for a slightly extended {% for ... in ... %} tag

2007-02-17 Thread Russell Keith-Magee
On 2/18/07, oggie rob <[EMAIL PROTECTED]> wrote: > > > I find it useful to have the {% for %} tag syntax extended so that one can > > write: > > {% for a,b in L %} meaning the obvious thing +1. > > Also (maybe more contentious): > > {% for i in L1,L2 %} meaning what one would write in python

Re: suggestion for a slightly extended {% for ... in ... %} tag

2007-02-17 Thread limodou
> I find it useful to have the {% for %} tag syntax extended so that one can > write: > {% for a,b in L %} meaning the obvious thing +1 > Also (maybe more contentious): > {% for i in L1,L2 %} meaning what one would write in python as: > for i in zip(L1,L2) +0 On 2/18/07, Gary Wilson <[EMAIL P

Re: suggestion for a slightly extended {% for ... in ... %} tag

2007-02-17 Thread Gary Wilson
On Feb 17, 3:58 pm, "Honza Král" <[EMAIL PROTECTED]> wrote: > On 2/17/07, oggie rob <[EMAIL PROTECTED]> wrote: > > > I find it useful to have the {% for %} tag syntax extended so that one > > > can write: > > > {% for a,b in L %} meaning the obvious thing > > +1 +1 The {{ x.0 }} syntax is simply

Re: suggestion for a slightly extended {% for ... in ... %} tag

2007-02-17 Thread Rubic
On Feb 17, 11:29 am, "Arnaud Delobelle" <[EMAIL PROTECTED]> wrote: > I find it useful to have the {% for %} tag syntax extended so that one > can write: > {% for a,b in L %} meaning the obvious thing +1 from me, too. Nicer than the current idiom. -- Jeff Bauer Rubicon, Inc. --~--~-~--

Re: suggestion for a slightly extended {% for ... in ... %} tag

2007-02-17 Thread oggie rob
> You can do this of course but it does not help to make sense of the > template. E.g. > > {% for key,value in L %} > {{ key }}->{{ value }} > {% endfor %} Yes, however you're looking at the case of only two variables. Think of how unmanageable it will start to look like this: {% for name,descr

Re: suggestion for a slightly extended {% for ... in ... %} tag

2007-02-17 Thread Arnaud Delobelle
[...] > If you change the tuples into dictionaries in the view, you can get > the same kind of clarity (and that's what I find myself doing quite a > bit, actually): > > {% for x in L %} > {{ x.name }} > {{ x.description }} > {% endfor %} > Yes I found myself doing that a lot too until I

Re: suggestion for a slightly extended {% for ... in ... %} tag

2007-02-17 Thread Arnaud Delobelle
On Feb 17, 9:48 pm, "oggie rob" <[EMAIL PROTECTED]> wrote: > > I find it useful to have the {% for %} tag syntax extended so that one can > > write: > > {% for a,b in L %} meaning the obvious thing > > You can do this. a,b return type is implicitly (a,b) in Python. In > other words: > {% for x

Re: suggestion for a slightly extended {% for ... in ... %} tag

2007-02-17 Thread Todd O'Bryan
On Feb 17, 2007, at 4:58 PM, Honza Král wrote: > On 2/17/07, oggie rob <[EMAIL PROTECTED]> wrote: >> >>> I find it useful to have the {% for %} tag syntax extended so >>> that one can write: >>> {% for a,b in L %} meaning the obvious thing > > +1 > >> >> You can do this. a,b return type is imp

Re: suggestion for a slightly extended {% for ... in ... %} tag

2007-02-17 Thread Honza Král
On 2/17/07, oggie rob <[EMAIL PROTECTED]> wrote: > > > I find it useful to have the {% for %} tag syntax extended so that one can > > write: > > {% for a,b in L %} meaning the obvious thing +1 > > You can do this. a,b return type is implicitly (a,b) in Python. In > other words: > {% for x in L %

Re: suggestion for a slightly extended {% for ... in ... %} tag

2007-02-17 Thread oggie rob
> I find it useful to have the {% for %} tag syntax extended so that one can > write: > {% for a,b in L %} meaning the obvious thing You can do this. a,b return type is implicitly (a,b) in Python. In other words: {% for x in L %} {{ x.0 }} {{ x.1 }} {% endfor %} > Also (maybe more contentiou

suggestion for a slightly extended {% for ... in ... %} tag

2007-02-17 Thread Arnaud Delobelle
Hi everyone, I have been using django with great pleasure and there is a slight extension to the {% for ... in ... %} default tag I would like to propose. I find it useful to have the {% for %} tag syntax extended so that one can write: {% for a,b in L %} meaning the obvious thing Also (maybe m