Re: Proposal for inclusion of two additional default template tags.

2011-01-07 Thread Horst Gutmann
On Fri, Jan 7, 2011 at 5:41 PM, Jonathan S wrote: >> Regarding the macro-tag I think the idea is valid but I'd personally >> prefer a more flexible approach regarding variables being  provided >> for the macro block. Something like Jinja's macro comes to mind where >>

Re: Proposal for inclusion of two additional default template tags.

2011-01-07 Thread Jonathan S
> Regarding the macro-tag I think the idea is valid but I'd personally > prefer a more flexible approach regarding variables being  provided > for the macro block. Something like Jinja's macro comes to mind where > I can define parameters for each macro and then pass them in as needed Jinja's

Re: Proposal for inclusion of two additional default template tags.

2011-01-07 Thread Horst Gutmann
On Fri, Jan 7, 2011 at 5:18 PM, Dougal Matthews wrote: > On Friday, 7 January 2011 at 16:11, Jonathan S wrote: > > ** And a {% decorate %} template tag: > http://paste.pocoo.org/show/316593/ > > I think they are generic enough to be included. > {% decorate %} implements a

Re: Proposal for inclusion of two additional default template tags.

2011-01-07 Thread Jonathan S
Not really. But I believe it's still pretty fast using Django's render engine. Probably about the same speed as using {% extends %} or {% include %} (By the way. We are working on a template preprocessor as well, and every {% extends %}, {% include %}, {% macro %} and {% decorate %} is

Re: Proposal for inclusion of two additional default template tags.

2011-01-07 Thread Jonas H.
On 01/07/2011 05:11 PM, Jonathan S wrote: ** And a {% decorate %} template tag: http://paste.pocoo.org/show/316593/ +1 {% macro %} avoids the usage of external template files. I think it's not worth the overhead of using an external file, when someone has to repeat small parts of code in a

Re: Proposal for inclusion of two additional default template tags.

2011-01-07 Thread Dougal Matthews
On Friday, 7 January 2011 at 16:11, Jonathan S wrote: > ** And a {% decorate %} template tag: > http://paste.pocoo.org/show/316593/ > > I think they are generic enough to be included. > {% decorate %} implements a commonly used design pattern. (Also known > by XAML programmers.) It avoids the

Proposal for inclusion of two additional default template tags.

2011-01-07 Thread Jonathan S
Hi all, Like {% include %} and {% extends %}, I think we can include two more template tags in Django's defaulttags for controlling the "render flow". Click the links below for a usage example. ** A {% macro %} template tag http://paste.pocoo.org/show/316592/ ** And a {% decorate %} template