On Wed, Jun 5, 2013 at 5:59 AM, Sebastian Goll <sebastian.g...@gmx.de> wrote:

> As an alternative to the explicit way, how about making the context 
> dictionary memoizable, i.e. let Django cache each value's object 
> transparently the first time it is retrieved?

I think that caching is a developer decision. If I want to not wast
time doing something that is not necessary I could use a evaluated
flag and process when it is False or return the result if it is True.
Doing that I have flexibility to decide when or not to evaluate
something.

I liked the Shai's solution:

{% for bee in my_bonnet.bees %}

 {% if forloop.first %}
    <ul class='bee list'>
 {% endif %}

     <li>{{ bee }}<li>

 {% if forloop.last %}
   </ul>
 {% endif %}

The spending time method is called only one time and the syntax is
very readable and already inside Django.

--
Elyézer Rezende
http://elyezer.com

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


Reply via email to