On Friday, May 13, 2011 1:01:26 AM UTC+1, Stodge wrote:
>
> Is there any interest in changing the inclusion template functionality 
> to let the function return the template name in the dictionary to the 
> inclusion_tag  decorator? This would let the developer override the 
> template filename: 
>
> {{{ 
> @register.inclusion_tag('block/render_region.html') 
> def render_region(slug): 
>
>     # Some random code that does nothing. 
>     if len(slug) == 0: 
>         return {'template': 'block/empty_region.html'} 
>
>     return {'region': region, 'blocks': blocks} 
> }}} 
>

You'd have to raise it on the developers list, preferably along with a 
ticket in the tracker.

However, I suspect your proposed syntax would not be accepted, as it would 
break any code that used a variable called 'template' in the context.
--
DR.

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

Reply via email to