On Oct 11, 1:17 am, iain duncan <[EMAIL PROTECTED]> wrote:
> I looked in the rough docs flash tips but didn't see the answer, so
> maybe I can add it to that doc if someone knows.
>
> Is there a way to access the whatever I tg_flashed from the method I
> redirect to? What's happening is that depending on the way the url is
> hit, it may just be delivered a rendered widget for DOM swapping, so i
> would like to but the flashed message into that widget.
>
> Example:
>
> def some_method(self):
>   do_stuff()
>   flash("stuff done")
>   raise redirect('/done_stuff?format=remote')
>
> def done_stuff(self):
>   if 'format' in kwargs and kwargs['format'] == 'remote':
>     msg = # magic flash accessor here!
>     return some_widget.render( message=msg )
>   else:
>     return dict( In The Normal Way )

Maybe try msg = request.simple_cookie.get("tg_flash") or some
variation of that.  I played around with it a little and I think that
is close to the right way to do it..just not sure how to ignore the
Set-Cookie part..

>
> Thanks
> Iain


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