Wiadomość napisana w dniu 2009-01-01, o godz. 19:07, przez Michał Moroz:

> I don't think this is optimal - after some looking at code there would
> be a get_template() called 30 times. On the other hand, writing
> ifequal tags for each type of message in main template should be
> faster, but the template code will lose on its clearness.
>
> After some thinking I've come with another solution - writing my own
> include tag with some cache that the template will only be compiled
> once. I guess it could be a bit slower than not using any inclusion
> tags, but not much. However I'm not sure if Django does not have some
> kind of similar mechanism in its core.


See http://www.djangosnippets.org/snippets/507/ for one of possible  
optimization techniques.

-- 
We read Knuth so you don't have to. - Tim Peters

Jarek Zgoda, R&D, Redefine
jarek.zg...@redefine.pl


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