Hi,

I would need clarifications on the processing of templates as I bumped 
into reality today:

 From a template, I call a model method that returns a dict (of 
statistics), i.e something like:

{{ model.method.dict_key_A }}
{{ model.method.dict_key_B }}
{{ model.method.dict_key_C }}

Today I wanted to debug some stuff, so I put a simple 'print' statement 
in my method.
I was surprised when I checked the output of my Django dev server:
I had my debug trace printed 3 times!

Basic logic tells me that my model method was called 3 times from the 
template,
each time the template looking for a particular key.
But my understanding of Django is that the method is called once, and 
the lookup is done afterwards.

How is my template handled in the background: is the method called 3 
times returning the same dict?
If so, I may have performance issues if the processing in the method 
takes some time :-(

Thanks for any info (or any interesting link on the subject, as I could 
not find anything yet).

--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

Reply via email to