Hello,

> given this approach, what if the third party app wants to self-extend
> a django admin template for example?

I'm working on an other solution that instead of relying on loader skipping
relies on template skipping.

Imagine you extend to a self-reference from within a template. All the
templates are ignored until the very same template is skipped and it then
continues normally.

This allows for apps to extend other apps and for filesystem templates to
extend other TEMPLATE_DIR roots while order is respected.

Now, the tricky part is to identify a template uniquely. I went for hashing
but, as Apollo13 said on IRC, that's just too expensive. After looking for a
while, it seems that both filesystem and app loaders work with absolute paths.
It seems to me the best way to identify a template uniquely.

The beauty of the solution is that template skipping is totally relegated to
app and filesystem loaders. Of course, some changes in django.template.loader
are needed but they are minor.

I'm currently having some debugging issues and I'm quite busy with other things
but I'll try to provide a complete PR this following week.

If you can think of any problems that this solution would arise don't hesitate
in telling ;)


Best wishes,

Unai Zalakain

Attachment: signature.asc
Description: PGP signature

Reply via email to