That's funny, as I was just talking about this with a few people at
the TWID party last night.

We had this problem at GCap and in a lot of cases (depending on your
architecture) you do actually want to say {% extends "base.html" %}
where the file is base.html, but the logic should be clever enough to
skip over itself until it finds the "base.html" somewhere down the
path, it just needs to be "aware of where it came from" when that
block is parsed, which is annoying. There are already a number of
tickets for it, and I have a crappy patch somewhere, but would need
some testing.

Some template languages allow you to pass in an extra attribute to the
"extends" which allows you to say whether you do actually want to skip
over yourself or not, but i'm not entirely sure I like that.

Also, i've had the problem on a number of platforms (OS X, Ubuntu
etc).

I could of course be talking crap because i'm tired and fueled by Red
Bull, but i'll take a look at this when I get back from DjangoCon.



On Aug 31, 7:38 pm, Martin Ostrovsky <[EMAIL PROTECTED]>
wrote:
> Now I'm not sure if this is a bug worth squashing or more a case of if
> you're dumb, you deserve what you get but ... I erroneously extended a
> template with itself (it was a typo, that's how I stumbled upon it).
> So say you have a template called home.html and had the following in
> it:
>
> {% extends 'home.html' %}
>
> This causes infinite recursion as
> django.template.loader_tag.ExtendsNode.get_parent is repeatedly called
> until Python says that's enough, and crashes. This also happens if
> template A extends template B and  template B extends  template A.
>
> Again, these two scenarios make no sense at all and don't represent
> logical use cases. I'm just wondering if it's something we want to
> address?
>
> - Martin
--~--~---------~--~----~------------~-------~--~----~
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