2013/12/9 Florian Apolloner <f.apollo...@gmail.com>

> On Monday, December 9, 2013 12:43:04 PM UTC+1, Goinnn wrote:
>>
>> 1. Efficiency: If this new solution slows the compilation/find/render
>> template, I dislike it
>>
>
> Lots of "ifs" which are not really worth discussing before we run actual
> benchmarks; also I think that it won't be slower since currently template
> resolving will iterate through all loaders anyways…
>
>

Unai said it: "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"...



>  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.
>>
>
> That is already the case, you can't know that 'admin/change_form.html'
> will be in the admin app.
>

Yes but now only can happen it a time, with the current PR, two
applications can not overwrite the 'admin/change_form.html' template. You
could find this template with a simple command, at least if you use a linux
OS.

IMHO I think that if we allow that an app template overwrite other app
template we will have a system very complex to develop and to debug.... but
this is only my opinion.


> I'd actually argue that your patch will make it even worse, since it's not
> clear on a first sight which loaders will be considered, to find that out
> you first have to figure out which loader loaded the template in the first
> place…
>
>
>> 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.
>>
>
> The current solution severely limits the usefulness of loading templates
> from app folders; personally I never have TEMPLATE_DIRS set to anything,
> but put my project module into INSTALLED_APPS -- why would I need different
> mechanisms to load project templates after all.
>

It is very very unusual for me, I don't understand why you do this. I
always have TEMPLATE_DIRS set for the common templates: base.html,
404.html, 500.html and to overwrite the reusable app templates. You could
see an example here:

https://github.com/OpenMOOC/moocng/tree/master/moocng/templates


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 django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
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/CALNyWLF-VGLbG3j_XQU7S75q0VpXHQzzj7jPum8_eDgyENJJng%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to