On Fri, 2009-03-06 at 10:51 -0500, Jacob Kaplan-Moss wrote:
> On Fri, Mar 6, 2009 at 4:25 AM, Thierry <thierryschellenb...@gmail.com> wrote:
> > Why is an include tag so much heavier on the template system?
> 
> Because it has to search for the given template on the file system.
> Depending on how you've got TEMPLATE_LOADERS and TEMPLATE_DIRS set,
> this could search in dozens of places.

And the "rating_small" variable in the original poster's case shows why
we have to reload the included template each time: it could be a
different one on different loops.

There are some optimisation possibilities here (e.g. if it's loaded from
a string literal), but we need to put in a rendering-reset feature to
the template code -- which we need to fix a couple of existing bugs
anyway, so it's probably coming soon -- first. That's something somebody
might want to look at in the Django 1.2 timeframe as a little
side-project.

Regards,
Malcolm



--~--~---------~--~----~------------~-------~--~----~
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