Hi,

Hmm... maybe try ChatRoom.objects.all().all() ? :)

If you run this, you can see if it's actually running sql or not:
import logging; logging.basicConfig(level=logging.DEBUG)

Are you sure you're using the same database? :)

Collin

On Sunday, March 8, 2015 at 8:41:30 AM UTC-4, Dheerendra Rathor wrote:
>
> I've a django project and I've few models like ChatRoom and Chat etc
>
> I'm accessing the ChatRooms from commandline using ipython as follow
> In [1]: import os
>
> In [2]: os.environ['DJANGO_SETTINGS_MODULE'] = 'chat_project.settings'
>
> In [3]: from chat.models import Chat, ChatRoom
>
> In [4]: ChatRoom.objects.all()
> Out[4]: [<ChatRoom: Lab 01>, <ChatRoom: Lab 02>, <ChatRoom: Lab 03>, 
> <ChatRoom: Lab 04>, <ChatRoom: Lab 05>, <ChatRoom: Lab 06>, <ChatRoom: Lab 
> 07>, <ChatRoom: Lab 10>, <ChatRoom: Lab 13>, <ChatRoom: Lab 14>, <ChatRoom: 
> Lab 15>, <ChatRoom: Lab 16>]
>
> Now, I'm adding more ChatRooms through web interface - Lab 17, Lab 18 and 
> deleting Lab 10
> Now the new output of 
> In [5]: ChatRoom.objects.all()
>
> The output is still the same
> Out[5]: [<ChatRoom: Lab 01>, <ChatRoom: Lab 02>, <ChatRoom: Lab 03>, 
> <ChatRoom: Lab 04>, <ChatRoom: Lab 05>, <ChatRoom: Lab 06>, <ChatRoom: Lab 
> 07>, <ChatRoom: Lab 10>, <ChatRoom: Lab 13>, <ChatRoom: Lab 14>, <ChatRoom: 
> Lab 15>, <ChatRoom: Lab 16>]
>
> the webinterface is running as wsgi application on gunicorn server. 
>
> I think the output on command line is not changed because the django 
> default model manager is accessing the objects from cache and not from 
> database itself. Is there anyway I can get the updated models here on 
> command line? Or can I force django ORM to fetch objects from database and 
> not from cache?
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/737ec68b-d2eb-46be-a86a-8703f665e4bc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to