On Fri, Jun 27, 2008 at 4:33 PM, Antonis Christofides
<[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> There are essentially two things that you can do with a block:
> (1) define it (or redefine it); and (2) insert it somewhere in a
> template.  The block tag thus performs different functions depending
> on circumstances:
>  * If a block tag with the same name exists in an inherited
>   template, then the block tag merely (re)defines the block.
>  * If no block tag with the same name is inherited, then the block tag
>   at the same time defines the block AND inserts it in the template.
>
> In my opinion, having two substantially different operations under one
> label is a cause for confusion. Explicit is better than implicit. I
> wonder whether it would be better the distinguish the functionality in
> "insblock" and "defblock":

No, please, don't. The master template has no place to "predefine" the
blocks as it's structure is outputted verbatim. Child templates on the
other hand have no need to define blocks outside of other blocks so
it's pretty much useless and prone to infinite loops (insert a parent
block in a sub-sub-sub-child block for example).

-- 
Patryk Zawadzki
PLD Linux Distribution

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to