2013/12/8 unai <[email protected]>

> 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 ;)
>
>
>
I think that this could have two problems, without see the code it's
possible that when I will see the code I will see another problems or I
like the complete solution:

 1. Efficiency: If this new solution slows the compilation/find/render
template, I dislike it
 2. This solution will complicate the template development. e.g. if a
application overwrite the "admin/change_form.html"  template and a
developer wants to update this template, he will have to search this
template in every app. He does not know what application is overwriting
this template... With the current solution [1] if you overwrite the
"admin/change_form.html" template this only (the most common usecase) will
be in a place, this will be in the template project directory.

For these reasons (above all the second reason), a priori this is not a
good solution for me.


REF's

1. https://github.com/django/django/pull/2042


Best regards,

--

Pablo Martín

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CALNyWLERNLiRzpCoBe7payf4JisC0vfmf0f0UPXnCMFOE-gVEg%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to