I'm calling a function (which is in an independant module) generating
a report and, as the task is quite long (about 20 seconds), I want to
give a feedback to the user.

I'm trying to monitor the progress storing data with session and
getting the session content every second by an ajax call.

In my independant module, I've just added "from tg import session" and
then update the status at several places with something like this :
    sessdata=session.get(sess,None)
    sessdata[0]=2
    session[sess]=sessdata
    session.save()

I got my status by a call every second (cache is disabeled on the
browser side) to a function in my controller:
    @expose("json")
    def factjson(self, **kw):
      sess=kw['sess']
      return(dict(valeurs=session.get(sess,None)))

My problem is that session data only seems updated when the call to
the reporting function ends. I only got first (when the session key is
created, inside my controller) and last status (last update in the
reporting function), nothing beetween while it should have changed
about 10 times. I've added a "print session.get(sess,None)" is my
function to check that it's really called every second (yes, it is)
and the return value.

I obviously missed something about session management but I can't see
what... any idea?

Christophe
-- 
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
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/turbogears?hl=en.


Reply via email to