[ZDP] BackTalk to Document The Zope Book (2.5 Edition)/Using Basic Zope Objects
Tue, 20 Aug 2002 08:43:03 -0400
A comment to the paragraph below was recently added via http://www.zope.org/Documentation/Books/ZopeBook/current/BasicObject.stx#3-187
Here's an example of how to work with a session using a
## Script (Python) "lastView"
if session.has_key('last view'):
# The script has been viewed before, since the 'last view'
# has been previously set in the session.
session['last view']=now # reset last view to now
return 'Seconds since last view %.2f' % ((now - then) * secs_per_day)
# The script hasn't been viewed before, since there's no 'last
# view' in the session data.
return 'This is your first view'
% Anonymous User - Aug. 20, 2002 8:43 am:
As far as I remember, "context" as in context.REQUEST.SESSION has not yet been discussed.
For the sake of understanding a sentence on "context" might be in order.