本文整理汇总了Python中model.Member.check_loged_user方法的典型用法代码示例。如果您正苦于以下问题:Python Member.check_loged_user方法的具体用法?Python Member.check_loged_user怎么用?Python Member.check_loged_user使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类model.Member
的用法示例。
在下文中一共展示了Member.check_loged_user方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: cur_user
# 需要导入模块: from model import Member [as 别名]
# 或者: from model.Member import check_loged_user [as 别名]
def cur_user(self):
user_name_cookie = self.get_cookie('username','')
user_code_cookie = self.get_cookie('usercode','')
if user_name_cookie and user_code_cookie:
from model import Member
return Member.check_loged_user(user_name_cookie, user_code_cookie)
else:
return None
示例2: authorized_handler
# 需要导入模块: from model import Member [as 别名]
# 或者: from model.Member import check_loged_user [as 别名]
def authorized_handler(self, *args, **kw):
request = self.request
user_name_cookie = self.get_cookie('username','')
user_code_cookie = self.get_cookie('usercode','')
if user_name_cookie and user_code_cookie:
from model import Member
user = Member.check_loged_user(user_name_cookie, user_code_cookie, flag)
else:
user = False
if request.method == 'GET':
if not user:
self.redirect(url)
return False
else:
handler(self, *args, **kw)
else:
if not user:
self.set_status(403)
#self.error(403)
else:
handler(self, *args, **kw)