On Monday, 22 August 2011 17:16:24 UTC+1, Julian Hodgson wrote: > > Hi there, > > I'm running a production linux django server using wsgi, and have found the > following issue. Django version (1, 2, 5, 'final', 0). > > If I open a python shell I get: > > >>> from passion.cg.models import * > >>> print Sequence.objects.all() > [<Sequence: DA>, <Sequence: DB>, <Sequence: DC>, <Sequence: DD>] > > > But if I go into the admin and delete sequence DD, leaving the python > session running, then I still get > > >>> print Sequence.objects.all() > [<Sequence: DA>, <Sequence: DB>, <Sequence: DC>, <Sequence: DD>] > > so the Sequence table doesn't appear to be updated as far as the model is > concerned. > > It's pretty fundamental that this can be resolved since many different > users will be using the database at the same time, and it should be possible > for each user to see the latest state of the DB. > > Any suggestions welcomed. > > Cheers, > > Julian >
This isn't anything to do with caching. It's a result of the fact that the shell session is running within a single transaction, and therefore doesn't see changes from outside that. If you quit the shell and restart it, you'll be able to see the change. This isn't a problem in production, because transactions in views are tied to the request/response cycle, which is short-lived. -- DR. > > -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/qX11CSPon3MJ. To post to this group, send email to [email protected]. 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.

