Paul Childs wrote:
> I wanted to do some checks through the shell, which I was opened
> during my unit testing, and found that after making some queries using
> Django objects there appeared to be no changes in the database. When I
> checked the database using its admin tool the changes were there.

This sounds like caching in querysets. When you do things like this:

     objects = Model.objects.all()
     for obj in objects:
       print obj

The 'objects' once evaluated don't look into database again, it keeps 
the result itself. To query database again just create a new queryset 
from the Model's manager:

     objects = Model.objects.all()

I.e. each 'Model.objects.something...' will create a fresh queryset that 
will query database 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to