* martedì 22 dicembre 2009, alle 15:40, Łukasz Balcerzak scrive:
> Well, I'm not sure then. Tried debug queries?
> Use django-logging or Djalog and add catching/printing queries middleware,
> you should spot the point where something is going wrong...

Found!

here: http://www.djangobook.com/en/1.0/chapter09/

says:
"The problem has to do with when the queries in extra_context are evaluated.
Because this example puts Publisher.objects.all() in the URLconf, it will be
evaluated only once (when the URLconf is first loaded). Once you add or remove
publishers, you’ll notice that the generic view doesn’t reflect those changes
until you reload the Web server (see “Caching and QuerySets” in Appendix C for
more information about when QuerySets are cached and evaluated)."

and furthermore:
"The solution is to use a callback in extra_context instead of a value. Any
callable (i.e., a function) that’s passed to extra_context will be evaluated
when the view is rendered (instead of only once). You could do this with an
explicitly defined function:"

and it works!!!

So, I hope this can help other people.
And thanks to whom answered me.

-- 
| Francesco Benincasa - http://ciccio2000.altervista.org/
| EcoSCIENZE Societa' Cooperativa - http://www.ecoscienze.org/
| Ingegneria Senza Frontiere Bologna - http://isf.ing.unibo.it/
| Bologna Free Software Forum - http://www.bfsf.it/

--

You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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