On Thu, Apr 03, 2008 at 01:08:38PM -0500, James Bennett wrote: > > On Thu, Apr 3, 2008 at 12:57 PM, Alessandro Dentella <[EMAIL PROTECTED]> > wrote: > > more. I'd like to understand why one of the 2 query used the cache and the > > other didn't. > > Nothing in Django will magically cache things when you haven't told > Django to cache things. > > Nothing in PostgreSQL will magically cache things when you haven't > told PostgreSQL to cache things. > > Most likely sources of your problem: > > 1. You're assigning a query result to a global variable inside a > module, and then referring to it later while expecting it to change > (it won't, since module-level code only initializes once per server > process, and this is normal Python behavior), or
Got it! thanks That's definitely something I was not thinking. In fact I made a module with some functions and I set at the module level: Notizie = News.objects.all().order_by('-data') thanks again *:-) --~--~---------~--~----~------------~-------~--~----~ 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?hl=en -~----------~----~----~----~------~----~------~--~---