本文整理汇总了Python中flaskbb.user.models.User.email方法的典型用法代码示例。如果您正苦于以下问题:Python User.email方法的具体用法?Python User.email怎么用?Python User.email使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类flaskbb.user.models.User
的用法示例。
在下文中一共展示了User.email方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: create_admin_user
# 需要导入模块: from flaskbb.user.models import User [as 别名]
# 或者: from flaskbb.user.models.User import email [as 别名]
def create_admin_user(username, password, email):
"""
Creates the administrator user
"""
admin_group = Group.query.filter_by(admin=True).first()
user = User()
user.username = username
user.password = password
user.email = email
user.primary_group_id = admin_group.id
user.save()
示例2: create_admin_user
# 需要导入模块: from flaskbb.user.models import User [as 别名]
# 或者: from flaskbb.user.models.User import email [as 别名]
def create_admin_user(username, password, email):
"""Creates the administrator user.
Returns the created admin user.
:param username: The username of the user.
:param password: The password of the user.
:param email: The email address of the user.
"""
admin_group = Group.query.filter_by(admin=True).first()
user = User()
user.username = username
user.password = password
user.email = email
user.primary_group_id = admin_group.id
user.activated = True
user.save()
return user