Re: Template inheritance and {% include %} tags

2008-09-19 Thread Simon Willison

On Sep 18, 11:58 pm, SmileyChris <[EMAIL PROTECTED]> wrote:
> I think you missed the point, Simon.
>
> Michael isn't talking about self-referencing extending, he's talking
> about blocks in statically included templates ({% include "bit.htm"
> %}).

Ah yes, sorry - misunderstood the original e-mail.

Cheers,

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



Re: Template inheritance and {% include %} tags

2008-09-18 Thread SmileyChris



On Sep 19, 9:17 am, Simon Willison <[EMAIL PROTECTED]> wrote:
> On Sep 18, 6:39 pm, Michael  Elsdörfer <[EMAIL PROTECTED]> wrote:
>
> > I remember this coming up on django-users and IRC once or twice, and
> > never thought too much about it, but currently, template inheritance
> > and includes don't work together at all:
>
> > * Blocks included in a parent template cannot be overwritten in a
> > child template.
> > * Blocks from an include in a child template cannot overwrite blocks
> > in a parent template.
>
> I've got a workaround for that which works pretty well:
>
> http://code.djangoproject.com/wiki/ExtendingTemplates
>
> Cheers,
>
> Simon

I think you missed the point, Simon.

Michael isn't talking about self-referencing extending, he's talking
about blocks in statically included templates ({% include "bit.htm"
%}).

I can't see a reason why at least static blocks shouldn't be exposed
as self.nodelist
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Template inheritance and {% include %} tags

2008-09-18 Thread Michael Elsdörfer

> I've got a workaround for that which works pretty well:
>
> http://code.djangoproject.com/wiki/ExtendingTemplates

Hm I might be misunderstanding, but it seems you're trying to
workaround the situation where two templates might not be uniquely
addressable. I can't quite make the connection to the issue I was
referring to (the fact that block-tags inside a template that was
included using {% include %} are ignored by the inheritance-
mechanism).

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



Re: Template inheritance and {% include %} tags

2008-09-18 Thread Simon Willison

On Sep 18, 6:39 pm, Michael  Elsdörfer <[EMAIL PROTECTED]> wrote:
> I remember this coming up on django-users and IRC once or twice, and
> never thought too much about it, but currently, template inheritance
> and includes don't work together at all:
>
> * Blocks included in a parent template cannot be overwritten in a
> child template.
> * Blocks from an include in a child template cannot overwrite blocks
> in a parent template.

I've got a workaround for that which works pretty well:

http://code.djangoproject.com/wiki/ExtendingTemplates

Cheers,

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



Template inheritance and {% include %} tags

2008-09-18 Thread Michael Elsdörfer

I remember this coming up on django-users and IRC once or twice, and
never thought too much about it, but currently, template inheritance
and includes don't work together at all:

* Blocks included in a parent template cannot be overwritten in a
child template.
* Blocks from an include in a child template cannot overwrite blocks
in a parent template.

Now that I was in a situation myself were this would have been handy,
I wonder why that doesn't (shouldn't?) work: It turns out that
changing ConstantIncudeNode to expose ``make self.template.nodelist``
as ``self.nodelist`` is all that is necessary (tests still pass).
Granted, for dynamic includes it is probably harder or possibly even
undoable (I haven't looked into that), but why not enable it for the
presumable prevalent use case (static includes)?

Am I overlooking something, or was there just no demand so far?

Related tickets: #7321 (invalid), possibly: #6646 (design decision
needed).

Michael

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