本文整理汇总了Python中coprs.logic.users_logic.UsersLogic.get_groups_by_fas_names_list方法的典型用法代码示例。如果您正苦于以下问题:Python UsersLogic.get_groups_by_fas_names_list方法的具体用法?Python UsersLogic.get_groups_by_fas_names_list怎么用?Python UsersLogic.get_groups_by_fas_names_list使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类coprs.logic.users_logic.UsersLogic
的用法示例。
在下文中一共展示了UsersLogic.get_groups_by_fas_names_list方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: coprs_migration_report
# 需要导入模块: from coprs.logic.users_logic import UsersLogic [as 别名]
# 或者: from coprs.logic.users_logic.UsersLogic import get_groups_by_fas_names_list [as 别名]
def coprs_migration_report(username=None):
if not username and not flask.g.user:
return generic_error("You are not logged in")
elif not username:
username = flask.g.user.name
user = UsersLogic.get(username).first()
coprs = CoprsLogic.filter_without_group_projects(CoprsLogic.get_multiple_owned_by_username(username)).all()
for group in UsersLogic.get_groups_by_fas_names_list(user.user_teams).all():
coprs.extend(CoprsLogic.get_multiple_by_group_id(group.id).all())
return render_migration_report(coprs, user=user)
示例2: list_user_groups
# 需要导入模块: from coprs.logic.users_logic import UsersLogic [as 别名]
# 或者: from coprs.logic.users_logic.UsersLogic import get_groups_by_fas_names_list [as 别名]
def list_user_groups():
teams = flask.g.user.user_teams
active_map = {
group.fas_name: group.name for group in
UsersLogic.get_groups_by_fas_names_list(teams).all()
}
teams = UsersLogic.filter_blacklisted_teams(teams)
copr_groups = {
fas_name: active_map.get(fas_name)
for fas_name in teams
}
return render_template(
"groups/user_fas_groups.html",
user=flask.g.user,
teams=teams,
copr_groups=copr_groups)