Re: {% with %} tag

2007-04-02 Thread [EMAIL PROTECTED]
Hi guys! I've done a patch to the "with" tag be able to accept multiple assignments without the need to nest many with tags, look the following example: {% with complicated.var.name1 as name1 and complicated.var.name2 as name2 %} {{ name1 }}, {{ name2 }} {% endwith %} I reopened

Re: {% with %} tag

2007-03-28 Thread Baptiste
It has been commited ; that is cool, but without any "and" or "," that is not cool. Like in my example, it is idiot to have to open a tag by variable... no? On Mar 27, 2:04 am, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Mon, 2007-03-26 at 17:06 -0500, Jacob Kaplan-Moss wrote: > > On 3/26/

Re: {% with %} tag

2007-03-26 Thread Malcolm Tredinnick
On Mon, 2007-03-26 at 17:06 -0500, Jacob Kaplan-Moss wrote: > On 3/26/07, SmileyChris <[EMAIL PROTECTED]> wrote: > > Sure: http://code.djangoproject.com/ticket/3826 > > Sweet; thanks. > > I'm gonna wait a couple of days for any objections from Malcom/Adrian, > but unless I hear any I'll add this

Re: {% with %} tag

2007-03-26 Thread Jacob Kaplan-Moss
On 3/26/07, SmileyChris <[EMAIL PROTECTED]> wrote: > Sure: http://code.djangoproject.com/ticket/3826 Sweet; thanks. I'm gonna wait a couple of days for any objections from Malcom/Adrian, but unless I hear any I'll add this shortly. Jacob --~--~-~--~~~---~--~~ Yo

Re: {% with %} tag

2007-03-26 Thread SmileyChris
On Mar 27, 3:07 am, "Jacob Kaplan-Moss" <[EMAIL PROTECTED]> wrote: > Chris: can you work up a patch in case we decide to check this in? Sure: http://code.djangoproject.com/ticket/3826 --~--~-~--~~~---~--~~ You received this message because you are subscribed to t

Re: {% with %} tag

2007-03-26 Thread Jacob Kaplan-Moss
in idle moments today about how > possible it would be to add transparent caching to templates. I actually the the {% with %} tag is a better choice for this -- "explicit is better than implicit" -- and after fooling with {% with %} a bit, I'd say I'm +0 on this. Barring a

Re: {% with %} tag

2007-03-26 Thread Malcolm Tredinnick
On Mon, 2007-03-26 at 11:17 +0200, Arvin Schnell wrote: > On Sat, Mar 24, 2007 at 06:42:08AM -, SmileyChris wrote: > > > > For a while I've been thinking that it would be nice to have a tag so > > you could re-use an expression in a template. > > I did one up and put it on http://www.djangosn

Re: {% with %} tag

2007-03-26 Thread Arvin Schnell
On Sat, Mar 24, 2007 at 06:42:08AM -, SmileyChris wrote: > > For a while I've been thinking that it would be nice to have a tag so > you could re-use an expression in a template. > I did one up and put it on http://www.djangosnippets.org/snippets/132/ > > Is this useful enough for core? I w

Re: {% with %} tag

2007-03-25 Thread SmileyChris
And just to make it clear, the main point of this patch is so that templates can benefit from the internal caching going on. Such as: {% for product in products %} {{ product }} {% with product.purchases.count as purchases %}({{ purchases }} purchase{{ purchases|pluralize }}){% endwith %} {% endf

Re: {% with %} tag

2007-03-25 Thread Brian Beck
On Mar 24, 3:01 pm, "Baptiste" <[EMAIL PROTECTED]> wrote: > For me, yes, but I miss the "and" : > {% with article.name as name and article.title as title %} > But it is an useful tag. If this were to go in, I think comma-delimiting multiple "assignments" would make more sense than using 'and': {

Re: {% with %} tag

2007-03-25 Thread Baptiste
ble nice and encapsulated. > > > On 3/24/07, Baptiste <[EMAIL PROTECTED]> wrote: > > > For me, yes, but I miss the "and" : > > > {% with article.name as name and article.title as title %} > > > But it is an useful tag. > > If you wanted to do

Re: {% with %} tag

2007-03-24 Thread SmileyChris
7, Baptiste <[EMAIL PROTECTED]> wrote: > > For me, yes, but I miss the "and" : > > {% with article.name as name and article.title as title %} > > But it is an useful tag. If you wanted to do this, you could just open another with tag. Apart from

Re: {% with %} tag

2007-03-24 Thread Aidas Bendoraitis
Wouldn't it be more convenient not to have the closing {% endwith %}? Once you defined a variable, you could use it anywhere in the template without taking care about closing tags. Regards, Aidas Bendoraitis [aka Archatas] On 3/24/07, Baptiste <[EMAIL PROTECTED]> wrote: > > For me, yes, but I m

Re: {% with %} tag

2007-03-24 Thread Baptiste
For me, yes, but I miss the "and" : {% with article.name as name and article.title as title %} But it is an useful tag. On Mar 24, 7:42 am, "SmileyChris" <[EMAIL PROTECTED]> wrote: > For a while I've been thinking that it would be nice to have a tag so > you could re-use an expression in a templa

{% with %} tag

2007-03-23 Thread SmileyChris
For a while I've been thinking that it would be nice to have a tag so you could re-use an expression in a template. I did one up and put it on http://www.djangosnippets.org/snippets/132/ Is this useful enough for core? --~--~-~--~~~---~--~~ You received this mess