import web
urls = ('/', 'Login')
app = web.application(urls, globals())
class Test:
lists = []
def bind(self, value):
self.lists.append(value)
class Login:
def GET(self):
test = Test()
test.bind('some value')
return rest.lists
def POST(self):
test = Test()
test.bind('another value')
return test.lists
if __name__ == '__main__':
app.run()
App run fine, but there are results:
localhost/login #get method >>> some value.
localhost/login #get method >>> some value, some value.
localhost/login #post method within form action >>> some value, some value, another value.
how is it possible ? expected result is that, after every request in test.lists will be ONLY ONE value