i see this example in web2py_manual_cut.pdf
code:
def index():
session.counter = (session.counter or 0) + 1
return dict(message="Hello from MyApp", counter=session.counter)
i try it in ipython and get a error
In [13]: session.test = (session.test or 0) + 1
---------------------------------------------------------------------------
AttributeError Traceback (most recent call
last)
/home/jean/Python/web2py/<ipython console> in <module>()
AttributeError: class session has no attribute 'test'
try another
In [14]: session.test = None
In [15]: session.test = (session.test or 0) + 1
i think web2py automatism a key None if the key not exist?
--
You received this message because you are subscribed to the Google Groups
"web2py-users" 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/web2py?hl=en.