#15102: find_template returns compiled Template object instead of template 
source
---------------------------------------------+------------------------------
          Reporter:  vmanchev                |         Owner:  vmanchev         
            
            Status:  assigned                |     Milestone:                   
            
         Component:  Template system         |       Version:  1.2              
            
        Resolution:                          |      Keywords:  find_template 
template source
             Stage:  Design decision needed  |     Has_patch:  1                
            
        Needs_docs:  0                       |   Needs_tests:  0                
            
Needs_better_patch:  0                       |  
---------------------------------------------+------------------------------
Comment (by vmanchev):

 Replying to [comment:3 ramiro]:
 > Before r11862 there was no `find_template` function or method and the
 `find_template_source` function entered a deprecation path so there was no
 unintended backward incompatible change but a explicit decision to not
 provide a way to access to the source code of the template.
 >
 I'm not sure why this decision was taken and why these methods were/are
 still in code in this case? Probably security concerns?
 Indeed, I don't really need `find_template_source`, we're using
 `find_template` which returns template source if using
 `django.template.loaders.app_directories.load_template_source` and
 `django.template.loaders.filesystem.load_template_source` as
 TEMPLATE_LOADERS.

 I noticed the problem when migrating part of our code base to Django 1.3 -
 I was getting deprecation warnings, wanted to get rid of them, so used new
 `django.template.loaders.app_directories.Loader` and
 `django.template.loaders.filesystem.Loader` as TEMPLATE_LOADERS.

 > There may be a case for a reviving an API to be able to do that. But
 would it be better to introduce it as a parallel API? (maybe reintroducing
 `find_template_source`?) instead of modifying the `find_template`
 signature?

 Anyway, I think this is a case for reviving an API - we're using this
 particular functionality in a home grown CMS and we prefer to continue
 using this even with future versions of Django.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/15102#comment:4>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to