I'm creating template objects programmatically, and I want one of these
objects to extend another, just as a template on the filesystem can {%
extends %}
another file.
I'm using magic-removal from svn. Any help would be appreciated.
Bryan
Hi Bryan,
The current best way to do that would be to change
django.template.loader.template_source_loaders to be a custom loader
(see the "Templates for Python programmers" docs). An example of this
is in run_tests() method in tests/othertests/templates.py. It's
hackish, but it works. If there's interest, we can expose things so
that you pass in the loader list as an optional argument to
get_template().
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com
Thanks for the reply, and for the suggestion. I've been working with
Ian Clelland, who submitted this patch a few days ago to address the
issue:
http://code.djangoproject.com/ticket/1650
There is definitely lots of interest over here for this functionality
to become part of Django, as it seems natural for {% extends %} to be
possible for non-filesystem templates.
Best Regards,
Bryan