Thanks Shawn for your reply. I was afraid if that was the only way. Anyways, I implemented using AJAX only. I already had a AJAX request being made from counter side every 3 seconds.
https://github.com/shadyabhi/pycourt_login/commit/e8303fe6a07761066a75226f7cd6dcb6d3c296f7 Thanks for that point. I didnt think about that. Anyways, its not a peoblem for my site because its only the student that registers, not the counter. Registering the counter is only done once using admin interface at the time of being deployed. Still, I will check that condition too. That would be a learning exercise for me as I am just a beginner in web development. On Thu, Apr 7, 2011 at 12:56 AM, Shawn Milochik <sh...@milochik.com> wrote: > Just to be pedantic, your model allows someone to be both a student > and a counter at the same time. If they must be mutually exclusive > then you can create one CharField which uses an iterable of choices, > or add custom code to your save() (and your modelform) to require > compliance. > > Unfortunately, there's no guaranteed way to know if a user is still > logged in just by the session. If you're using Comet you can be pretty > sure, depending on how quickly the Comet backend becomes aware of an > unsubscribe action. With AJAX you could do some kind of regular > check-in, but that solution sucks. Otherwise, if a person requests a > page on your site (refreshing their "last seen" status), they can > close their browser immediately after and you wouldn't know. > > Shawn > > -- > 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 > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > > -- Regards, Abhijeet Rastogi (shadyabhi) http://www.google.com/profiles/abhijeet.1989 -- 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 django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.