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