本文整理汇总了Python中torlite.model.muser.MUser.update_info方法的典型用法代码示例。如果您正苦于以下问题:Python MUser.update_info方法的具体用法?Python MUser.update_info怎么用?Python MUser.update_info使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类torlite.model.muser.MUser
的用法示例。
在下文中一共展示了MUser.update_info方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: UserHandler
# 需要导入模块: from torlite.model.muser import MUser [as 别名]
# 或者: from torlite.model.muser.MUser import update_info [as 别名]
#.........这里部分代码省略.........
self.reset_password()
elif url_arr[0] == 'changeprivilege':
self.changeprivilege(url_arr[1])
@tornado.web.authenticated
def p_changepassword(self):
post_data = {}
for key in self.request.arguments:
post_data[key] = self.get_arguments(key)
uu = self.muser.check_user(self.user_name, post_data['rawpass'][0])
if uu == 1:
self.muser.update_pass(self.user_name, post_data['user_pass'][0])
output = {
'changepass ': uu,
}
else:
output = {
'changepass ': 0,
}
return json.dump(output, self)
@tornado.web.authenticated
def p_changeinfo(self):
post_data = {}
for key in self.request.arguments:
post_data[key] = self.get_arguments(key)
uu = self.muser.check_user(self.user_name, post_data['rawpass'][0])
if uu == 1:
self.muser.update_info(self.user_name, post_data['user_email'][0])
output = {
'changeinfo ': uu,
}
else:
output = {
'changeinfo ': 0,
}
return json.dump(output, self)
@tornado.web.authenticated
def changepassword(self):
post_data = {}
for key in self.request.arguments:
post_data[key] = self.get_arguments(key)
uu = self.muser.check_user(self.user_name, post_data['rawpass'][0])
if uu == 1:
self.muser.update_pass(self.user_name, post_data['user_pass'][0])
self.redirect(('/{0}/info').format(self.tmpl_router))
else:
return False
@tornado.web.authenticated
def changeinfo(self):
post_data = {}
for key in self.request.arguments:
post_data[key] = self.get_arguments(key)
uu = self.muser.check_user(self.user_name, post_data['rawpass'][0])
if uu == 1:
示例2: UserHandler
# 需要导入模块: from torlite.model.muser import MUser [as 别名]
# 或者: from torlite.model.muser.MUser import update_info [as 别名]
class UserHandler(BaseHandler):
def initialize(self):
self.muser = MUser()
self.user_name = self.get_current_user()
def get(self, url_str):
url_arr = url_str.split('/')
if url_str == 'regist':
if self.get_current_user():
self.redirect('/')
else:
self.__to_register__()
elif url_str == 'login':
self.to_login()
elif url_str == 'info':
self.show_info()
elif url_str == 'logout':
self.logout()
elif url_str == 'changepass':
self.changepass()
elif url_str == 'changeinfo':
self.change_info()
elif url_arr[0] == 'changeprivilege':
self.change_privilege(url_arr[1])
elif url_str == 'find':
self.to_find()
elif url_arr[0] == 'find':
self.find(url_arr[1])
def post(self, url_str):
url_arr = url_str.split('/')
if url_str == 'regist':
self.register()
elif url_str == 'login':
self.login()
elif url_str == 'changepass':
self.changepassword()
elif url_str == 'changeinfo':
self.changeinfo()
elif url_str == 'find':
self.post_find()
elif url_arr[0] == 'changeprivilege':
self.changeprivilege(url_arr[1])
@tornado.web.authenticated
def changepassword(self):
post_data = {}
for key in self.request.arguments:
post_data[key] = self.get_arguments(key)
uu = self.muser.check_user(self.user_name, post_data['rawpass'][0])
print(uu)
if uu == 1:
self.muser.update_pass(self.user_name, post_data['user_pass'][0])
self.redirect(('/user/info'))
else:
return False
@tornado.web.authenticated
def changeinfo(self):
post_data = {}
for key in self.request.arguments:
post_data[key] = self.get_arguments(key)
uu = self.muser.check_user(self.user_name, post_data['rawpass'][0])
print(uu)
if uu == 1:
self.muser.update_info(self.user_name, post_data['user_email'][0])
self.redirect(('/user/info'))
else:
return False
@tornado.web.authenticated
def changeprivilege(self, xg_username):
post_data = {}
for key in self.request.arguments:
post_data[key] = self.get_arguments(key)
self.muser.update_privilege(xg_username, post_data['privilege'][0])
self.redirect(('/user/info'))
@tornado.web.authenticated
def logout(self):
self.clear_all_cookies()
self.redirect('/')
@tornado.web.authenticated
def changepass(self):
self.render('tplite/user/changepass.html',
user_info=self.muser.get_by_id(self.user_name))
@tornado.web.authenticated
def change_info(self):
self.render('tplite/user/changeinfo.html',
user_info=self.muser.get_by_id(self.user_name))
@tornado.web.authenticated
def change_privilege(self, xg_username):
self.render('tplite/user/changeprivilege.html',
#.........这里部分代码省略.........