本文整理匯總了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)