本文整理汇总了Python中db.User.nickname方法的典型用法代码示例。如果您正苦于以下问题:Python User.nickname方法的具体用法?Python User.nickname怎么用?Python User.nickname使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类db.User
的用法示例。
在下文中一共展示了User.nickname方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: r_success
# 需要导入模块: from db import User [as 别名]
# 或者: from db.User import nickname [as 别名]
def r_success():
nickname = request.form["nickname"]
email = request.form["email"]
passwd = request.form["passwd"]
repasswd = request.form["repasswd"]
if passwd != repasswd:
return "비밀번호가 다릅니다."
if len(passwd) < 8:
return """
<script>
alert("비밀번호를 8자리 이상 적어주세요.");
history.back();
</script>
"""
if not len(email) or not len(nickname):
return """
<script>
alert("모두 채워 주세요.");
history.back();
</script>
"""
if is_already_registered(email, nickname) == 2:
return "메일"
if is_already_registered(email, nickname) == 3:
return "별명"
new = User()
new.nickname = nickname
new.email = email
new.pw = passwd
db.session.add(new)
db.session.commit()
return render_template("index.html")
示例2: create
# 需要导入模块: from db import User [as 别名]
# 或者: from db.User import nickname [as 别名]
def create():
new = User()
new.userId = request.form['id']
new.userPw = request.form['pw']
new.nickname = request.form['nickname']
if new.userId and new.userPw and new.nickname :
db.session.add(new)
try:
db.session.commit()
except IntegrityError:
return "이미 있습니다."
return "%s (%s %s)" % (new.nickname, new.userId, new.userPw)
else:
return "내용을 전부 채워야합니다"