本文整理汇总了Python中pycket.session.SessionManager.delete方法的典型用法代码示例。如果您正苦于以下问题:Python SessionManager.delete方法的具体用法?Python SessionManager.delete怎么用?Python SessionManager.delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pycket.session.SessionManager
的用法示例。
在下文中一共展示了SessionManager.delete方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: deletes_multiple_session_objects_at_once
# 需要导入模块: from pycket.session import SessionManager [as 别名]
# 或者: from pycket.session.SessionManager import delete [as 别名]
def deletes_multiple_session_objects_at_once(self):
handler = StubHandler()
manager = SessionManager(handler)
manager.set('some-object', {'foo': 'bar'})
manager.set('some-object2', {'foo2': 'bar2'})
manager.delete('some-object', 'some-object2')
raw_session = self.client.get(handler.session_id)
session = pickle.loads(raw_session)
self.assertEqual(list(session.keys()), [])
示例2: deletes_objects_from_session
# 需要导入模块: from pycket.session import SessionManager [as 别名]
# 或者: from pycket.session.SessionManager import delete [as 别名]
def deletes_objects_from_session(self):
handler = StubHandler()
manager = SessionManager(handler)
manager.set('some-object', {'foo': 'bar'})
manager.set('some-object2', {'foo2': 'bar2'})
manager.delete('some-object')
raw_session = self.client.get(handler.session_id)
session = pickle.loads(raw_session)
self.assertEqual(session.keys(), ['some-object2'])
示例3: post
# 需要导入模块: from pycket.session import SessionManager [as 别名]
# 或者: from pycket.session.SessionManager import delete [as 别名]
def post(self):
session=SessionManager(self)
session.delete(self)
self.redirect("http://lyket.com/")
示例4: get
# 需要导入模块: from pycket.session import SessionManager [as 别名]
# 或者: from pycket.session.SessionManager import delete [as 别名]
def get(self):
session = SessionManager(self)
session.delete('authenticated')
sessionid = self.get_current_session()
self.Disconnect(sessionid)
self.redirect("/auth/login")
示例5: delete
# 需要导入模块: from pycket.session import SessionManager [as 别名]
# 或者: from pycket.session.SessionManager import delete [as 别名]
def delete(cls, handler, name):
session = SessionManager(handler)
session.delete(name)