本文整理汇总了Python中tracim.lib.user.UserApi.get_all方法的典型用法代码示例。如果您正苦于以下问题:Python UserApi.get_all方法的具体用法?Python UserApi.get_all怎么用?Python UserApi.get_all使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tracim.lib.user.UserApi
的用法示例。
在下文中一共展示了UserApi.get_all方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_all
# 需要导入模块: from tracim.lib.user import UserApi [as 别名]
# 或者: from tracim.lib.user.UserApi import get_all [as 别名]
def get_all(self, *args, **kw):
current_user = tmpl_context.current_user
api = UserApi(current_user)
users = api.get_all()
current_user_content = Context(CTX.CURRENT_USER).toDict(current_user)
fake_api = Context(CTX.USERS).toDict({'current_user': current_user_content})
dictified_users = Context(CTX.USERS).toDict(users, 'users', 'user_nb')
return DictLikeClass(result = dictified_users, fake_api=fake_api)
示例2: get_one
# 需要导入模块: from tracim.lib.user import UserApi [as 别名]
# 或者: from tracim.lib.user.UserApi import get_all [as 别名]
def get_one(self, workspace_id):
user = tmpl_context.current_user
workspace_api_controller = WorkspaceApi(user)
role_api = RoleApi(tg.tmpl_context.current_user)
user_api = UserApi(tg.tmpl_context.current_user)
workspace = workspace_api_controller.get_one(workspace_id)
role_list = role_api.get_roles_for_select_field()
user_list = user_api.get_all()
current_user_content = Context(CTX.CURRENT_USER).toDict(user)
dictified_workspace = Context(CTX.ADMIN_WORKSPACE).toDict(workspace, 'workspace')
fake_api_content = DictLikeClass(role_types=role_list, users=user_list, current_user=current_user_content)
fake_api = Context(CTX.ADMIN_WORKSPACE).toDict(fake_api_content)
return dict(result = dictified_workspace, fake_api = fake_api)