本文整理汇总了Python中cyclone.util.ObjectDict.username方法的典型用法代码示例。如果您正苦于以下问题:Python ObjectDict.username方法的具体用法?Python ObjectDict.username怎么用?Python ObjectDict.username使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cyclone.util.ObjectDict
的用法示例。
在下文中一共展示了ObjectDict.username方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_current_user
# 需要导入模块: from cyclone.util import ObjectDict [as 别名]
# 或者: from cyclone.util.ObjectDict import username [as 别名]
def get_current_user(self):
username = self.get_secure_cookie("mps_user")
if not username: return None
user = ObjectDict()
user.username = username
return user
示例2: get_current_user
# 需要导入模块: from cyclone.util import ObjectDict [as 别名]
# 或者: from cyclone.util.ObjectDict import username [as 别名]
def get_current_user(self):
session_opr = ObjectDict()
session_opr.username = 'api'
session_opr.ipaddr = self.request.remote_ip
session_opr.opr_type = 0
session_opr.login_time = utils.get_currtime()
return session_opr
示例3: set_session_user
# 需要导入模块: from cyclone.util import ObjectDict [as 别名]
# 或者: from cyclone.util.ObjectDict import username [as 别名]
def set_session_user(self, username, ipaddr, login_time):
session_user = ObjectDict()
session_user.username = username
session_user.ipaddr = ipaddr
session_user.login_time = login_time
self.session['session_user'] = session_user
self.session.save()
示例4: set_session_user
# 需要导入模块: from cyclone.util import ObjectDict [as 别名]
# 或者: from cyclone.util.ObjectDict import username [as 别名]
def set_session_user(self, customer, ipaddr, login_time):
session_user = ObjectDict()
session_user.username = customer.customer_name
session_user.cid = customer.customer_id
session_user.ipaddr = ipaddr
session_user.login_time = login_time
self.session['session_user'] = session_user
self.session.save()
示例5: set_session_user
# 需要导入模块: from cyclone.util import ObjectDict [as 别名]
# 或者: from cyclone.util.ObjectDict import username [as 别名]
def set_session_user(self, username, ipaddr, opr_type, login_time):
session_opr = ObjectDict()
session_opr.username = username
session_opr.ipaddr = ipaddr
session_opr.opr_type = opr_type
session_opr.login_time = login_time
self.session['session_opr'] = session_opr
self.session.save()
示例6: get_current_user
# 需要导入模块: from cyclone.util import ObjectDict [as 别名]
# 或者: from cyclone.util.ObjectDict import username [as 别名]
def get_current_user(self):
username = self.get_secure_cookie("portal_user")
if not username: return None
ipaddr = self.get_secure_cookie("portal_user_ip")
user = ObjectDict()
user.username = username
user.ipaddr = ipaddr
return user
示例7: get_current_user
# 需要导入模块: from cyclone.util import ObjectDict [as 别名]
# 或者: from cyclone.util.ObjectDict import username [as 别名]
def get_current_user(self):
return self.session.get("session_user")
if not username: return None
user = ObjectDict()
user.username = username
user.ipaddr = self.session.get("tr_login_ip")
user.login_time = self.session.get("tr_login_time")
return user
示例8: set_session_user
# 需要导入模块: from cyclone.util import ObjectDict [as 别名]
# 或者: from cyclone.util.ObjectDict import username [as 别名]
def set_session_user(self, username, ipaddr, opr_type, login_time):
session_opr = ObjectDict()
session_opr.username = username
session_opr.ipaddr = ipaddr
session_opr.opr_type = opr_type
session_opr.login_time = login_time
session_opr.resources = [r.rule_path for r in self.db.query(models.TrOperatorRule).filter_by(operator_name=username)]
self.session['session_opr'] = session_opr
self.session.save()
示例9: get_current_user
# 需要导入模块: from cyclone.util import ObjectDict [as 别名]
# 或者: from cyclone.util.ObjectDict import username [as 别名]
def get_current_user(self):
username = self.get_secure_cookie("tra_user")
if not username: return None
ipaddr = self.get_secure_cookie("tra_login_ip")
user = ObjectDict()
user.username = username
user.ipaddr = ipaddr
user.opr_type = self.get_secure_cookie("tra_opr_type")
user.login_time = self.get_secure_cookie("tra_login_time")
return user
示例10: get_current_user
# 需要导入模块: from cyclone.util import ObjectDict [as 别名]
# 或者: from cyclone.util.ObjectDict import username [as 别名]
def get_current_user(self):
username = self.get_secure_cookie("opr_name")
if not username: return None
ipaddr = self.get_secure_cookie("opr_login_ip")
opr_type = int(self.get_secure_cookie("opr_type"))
login_time = self.get_secure_cookie("opr_login_time")
user = ObjectDict()
user.username = username
user.ipaddr = ipaddr
user.opr_type = opr_type
user.login_time = login_time
return user