Very nice code thx.

On 30 jan, 04:52, "Patrick Lewis" <[EMAIL PROTECTED]> wrote:
> On Jan 29, 10:01 pm, "Patrick Lewis" <[EMAIL PROTECTED]> wrote:
>
> > I believe this model implements a session pretty well using just
> > TurboGears Visit to manage the cookie information.
>
> >http://paste.turbogears.org/paste/934
>
> Probably should have included a simple controller to show  a little
> more usage:
>
> @expose()
> def session_test(self, key, value=None):
>     s = Session.session()
>     if value:
>         s[key]=value
>         return 'Saved %s=%s in session.' % (key, value)
>     try:
>         val = s[key]
>     except KeyError:
>         return "No value found for key '%s'" % key
>
>     return 'Retrieved session value "%s" for key "%s"' % (val,
>                     key)


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