> > The problem is that it resets when the visitor first comes to the page.
> > In other words, when I go to the site first thing in the morning
> > last_seen resets to NOW.

But that's exactly what your code says :

> >             l = request.session['last_seen']
> >             last = now -l
> >             # don't update it too often, every 4 hours should be ok
> >             if last.seconds > (60 * 60 * 4):
> >                 request.session['last_seen']  =
> > datetime.datetime.now()

i.e. If it's more than 4 hours after the "last_seen" time, change the "last
seen" time to "now".

I think you need to think about your algorithm. Ignore the code for now -
how would you do this by hand ?

Chris




--~--~---------~--~----~------------~-------~--~----~
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