#14369: TEMPLATE_STRING_IF_INVALID settable per template rendering
-----------------------------+----------------------------------------------
 Reporter:  vanschelven      |       Owner:  nobody    
   Status:  new              |   Milestone:            
Component:  Template system  |     Version:  1.2       
 Keywords:                   |       Stage:  Unreviewed
Has_patch:  0                |  
-----------------------------+----------------------------------------------
 It would be nice if TEMPLATE_STRING_IF_INVALID is settable per template
 rendering.

 I have created a version of this here:
 http://bitbucket.org/vanschelven/django/changeset/7cfe30a771b7

 In this particular prototype the TEMPLATE_STRING_IF_INVALID is looked up
 in the context, as well as in the settings (in that order).
 A greater reworking of the templating system would allow for
 template.render(......, string_if_invalid="YOUR_STRING %s")

 In some cases you want to be absolutely sure that whatever you tell the
 template to render either shows up, or generates an error.
 This can also be used in combination with Exceptions on rendering by using
 a tool like this:

 
http://bitbucket.org/vanschelven/django_invalid_template_exception/src/2c5772c3f21d/invalid_template_exception/__init__.py

 In some cases (notably the admin) it is unfortunately currently impossible
 to use the TEMPLATE_STRING_IF_INVALID at all.
 Having a per-template approach allows for more flexibility.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/14369>
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 django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to