this very sample taken from http://webpy.org/cookbook/sessions raises
an error when using git cloned of web.py from last week.
The error:
Traceback (most recent call last):
File "/usr/lib/python2.5/site-packages/web/application.py", line
182, in process
return self.handle()
File "/usr/lib/python2.5/site-packages/web/application.py", line
172, in handle
return self._delegate(fn, self.fvars, args)
File "/usr/lib/python2.5/site-packages/web/application.py", line
353, in _delegate
return handle_class(cls)
File "/usr/lib/python2.5/site-packages/web/application.py", line
328, in handle_class
return tocall(*args)
File "/home/tzury/Desktop/sample_session.py", line 11, in GET
session.count += 1
File "/usr/lib/python2.5/site-packages/web/utils.py", line 830, in
__getattr__
return getattr(self._getd(), key)
File "/usr/lib/python2.5/site-packages/web/utils.py", line 64, in
__getattr__
raise AttributeError, k
AttributeError: 'count'
The code:
import web
urls = (
"/count", "count",
"/reset", "reset"
)
app = web.application(urls, locals())
session = web.session.Session(app, web.session.DiskStore('sessions'),
initializer={'count': 0})
class count:
def GET(self):
session.count += 1
return str(session.count)
class reset:
def GET(self):
session.kill()
return ""
if __name__ == "__main__":
app.run()
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---