krsyoung schrieb:
> Hey,
>
> I'm having a caching problem with my application (or so I think). The
> problem shows up in both IE and Firefox (settings to Load Page Every
> Visit). In the controller I have code like:
>
> @expose()
> def hold(self, id):
> r = Request.get(id)
> r.hold()
> print r
> redirect('/view/%d' % r.id)
> return
>
> @expose()
> def resume(self, id):
> r = ServiceRequest.get(id)
> r.resume()
> print r
> redirect('/view/%d' % r.id)
> return
>
> The r.hold and r.resume functions in model.py look like:
>
> def hold(self):
> self.state = STATE_ON_HOLD
> return
>
> def resume(self):
> self.state = STATE_IN_PROGRESS
> return
>
> In both cases the action is invoked from a button on the "view" page.
> The problem seems to be sometimes when I press hold the request will
> go from STATE_IN_PROGRESS to STATE_ON_HOLD, but other times the view
> will keep showing STATE_IN_PROGRESS (as if either the page is being
> cached by the browser, or some thread in TG). If I check the console
> for the output of the print statements the request object always has
> the correct state.
>
> Is it possible that a) SQLObject has multiple versions of the object
> hanging around and is passing an old version to the "view" template?
> b) Somehow this is a browser issue and it just can't seem to guess
> when a page has been updated and when it hasn't?
>
> Any ideas what I could try to confirm a or b or maybe a better way to
> write the code to avoid the issue?
Are you doing this using AJAX? Then try appending a tg_random-named
parameter containing e.g. the current timestamp to the request. That
should solve caching issues.
I don't presume there is a SO-problem.
diez
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---