*clever...
*


On Tue, Mar 30, 2010 at 1:09 PM, W. Martin Borgert <[email protected]>wrote:

> Quoting "Branko Vukelic" <[email protected]>:
>
>> On Tue, Mar 30, 2010 at 5:27 PM, W. Martin Borgert <[email protected]>
>> wrote:
>>
>>> for "notfound" and "internalerror" it is easy to generate
>>> an error page. Is there a straight-forward way in case of
>>> session expiry? By default, only the plain text "Session
>>> expired" is shown, it seems. Thanks in advance!
>>>
>>
>> I haven't deal with this before, but I think you could pass a
>> _rendered_ template as session expiry message.
>>
>
> Thanks, this works indeed! In my case it was a little bit more
> difficult, because I don't want a static error page, but one
> that gets translated on the fly (i.e. after a user changed
> their language settings). My solution looks now like this:
>
>
> class MySessionExpired(web.HTTPError):
>    def __init__(self, message):
>        message = myrendering()
>        web.HTTPError.__init__(self, '200 OK', {}, data=message)
>
> web.session.SessionExpired = MySessionExpired
>
>
> It would be nice to have a solution similar to notfound and
> internalerror in a future web.py release anyway.
>
> Cheers
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "web.py" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected] <webpy%[email protected]>.
> For more options, visit this group at
> http://groups.google.com/group/webpy?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"web.py" 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/webpy?hl=en.

Reply via email to