当前位置: 首页>>代码示例>>Python>>正文


Python models.User类代码示例

本文整理汇总了Python中flaskbb.user.models.User的典型用法代码示例。如果您正苦于以下问题:Python User类的具体用法?Python User怎么用?Python User使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了User类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: super_moderator_user

def super_moderator_user(default_groups):
    """Creates a super moderator user."""
    user = User(username="test_super_mod", email="[email protected]",
                password="test", primary_group=default_groups[1],
                activated=True)
    user.save()
    return user
开发者ID:BenDerPan,项目名称:flaskbb,代码行数:7,代码来源:user.py

示例2: admin_user

def admin_user(default_groups):
    """Creates a admin user."""
    user = User(username="test_admin", email="[email protected]",
                password="test", primary_group=default_groups[0],
                activated=True)
    user.save()
    return user
开发者ID:BenDerPan,项目名称:flaskbb,代码行数:7,代码来源:user.py

示例3: user

def user(default_groups):
    """Creates a user with normal permissions."""
    user = User(username="test_normal", email="[email protected]",
                password="test", primary_group=default_groups[3],
                activated=True)
    user.save()
    return user
开发者ID:BenDerPan,项目名称:flaskbb,代码行数:7,代码来源:user.py

示例4: save

 def save(self):
     user = User(username=self.username.data,
                 email=self.email.data,
                 password=self.password.data,
                 date_joined=datetime.utcnow(),
                 primary_group_id=4)
     return user.save()
开发者ID:FooBarQuaxx,项目名称:flaskbb,代码行数:7,代码来源:forms.py

示例5: create_admin_user

def create_admin_user(username, password, email):
    """
    Creates the administrator user
    """
    admin_group = Group.query.filter_by(admin=True).first()
    user = User(username=username, password=password, email=email,
                date_joined=datetime.utcnow(), primary_group_id=admin_group.id)
    user.save()
开发者ID:hvdklauw,项目名称:flaskbb,代码行数:8,代码来源:populate.py

示例6: unactivated_user

def unactivated_user(default_groups):
    """
    Creates an unactivated user in the default user group
    """
    user = User(username='notactive', email='[email protected]',
                password='password', primary_group=default_groups[3],
                activated=False)
    user.save()
    return user
开发者ID:eirnym,项目名称:flaskbb,代码行数:9,代码来源:user.py

示例7: moderator_user

def moderator_user(forum, default_groups):
    """Creates a test user for whom the permissions should be checked"""

    user = User(username="test_mod", email="[email protected]",
                password="test", primary_group_id=default_groups[2].id)
    user.save()

    forum.moderators.append(user)
    forum.save()
    return user
开发者ID:hugleecool,项目名称:flaskbb,代码行数:10,代码来源:user.py


注:本文中的flaskbb.user.models.User类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。