On Fri, Jun 27, 2008 at 4:33 PM, Antonis Christofides
<[EMAIL PROTECTED]> wrote:
> 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.

    class A(object):
        def meth(self):
            return "A"

    class B(A):
        def meth(self):
            return "B"

--------------------------------------------------

    (a.html)
    {% block bl %}A{% endblock %}

    (b.html)
    {% extends "a.html" %}
    {% block bl %}B{% endblock %}

Can you see the similarity? It's a hierarchy. A base.html with a block
"content" without content or a placeholder is just like an abstract
class.

HTH,
Ludvig

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com
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