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


Python User.get_user_name方法代码示例

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


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

示例1: get_groups

# 需要导入模块: from models.user import User [as 别名]
# 或者: from models.user.User import get_user_name [as 别名]
def get_groups():
    appid = request.appid
    uid = request.uid

    groups = Group.get_groups(g._db, appid, uid)
    fields = request.args.get("fields", '')

    fields = fields.split(",")
    for obj in groups:
        gid = obj['id']
        if "members" in fields:
            members = Group.get_group_members(g._db, gid)
            for m in members:
                name = User.get_user_name(g.rds, appid, m['uid'])
                m['name'] = name if name else ''
                if not m.get('nickname'):
                    m['nickname'] = ""
                    
            obj['members'] = members
     
        if "quiet" in fields:
            q = User.get_group_do_not_disturb(g.rds, appid, uid, gid)
            obj['do_not_disturb'] = bool(q)
        
    resp = {"data":groups}
    return make_response(200, resp)
开发者ID:richmonkey,项目名称:gobelieve_api,代码行数:28,代码来源:client_group.py

示例2: leave_group_member

# 需要导入模块: from models.user import User [as 别名]
# 或者: from models.user.User import get_user_name [as 别名]
def leave_group_member(gid, memberid):
    appid = request.appid
    group = Group.get_group(g._db, gid)
    if not group:
        raise ResponseMeta(400, "group non exists")

    name = User.get_user_name(g.rds, appid, memberid)
    m = {"uid":memberid}
    if name:
        m['name'] = name
    remove_group_member(appid, gid, group['name'], m)
    
    resp = {"success":True}
    return make_response(200, resp)
开发者ID:richmonkey,项目名称:gobelieve_api,代码行数:16,代码来源:group.py

示例3: get_group

# 需要导入模块: from models.user import User [as 别名]
# 或者: from models.user.User import get_user_name [as 别名]
def get_group(gid):
    appid = request.appid
    uid = request.uid

    obj = Group.get_group(g._imdb, gid)
    members = Group.get_group_members(g._imdb, gid)
    for m in members:
        name = User.get_user_name(g.rds, appid, uid)
        m['name'] = name if name else ''
    obj['members'] = members

    q = User.get_user_notification_quiet(g.rds, appid, uid, gid)
    obj['quiet'] = bool(q)

    resp = {"data":obj}
    return make_response(200, resp)
开发者ID:chenklet,项目名称:gobelieve_api,代码行数:18,代码来源:group.py

示例4: get_group

# 需要导入模块: from models.user import User [as 别名]
# 或者: from models.user.User import get_user_name [as 别名]
def get_group(gid):
    appid = request.appid
    uid = request.uid

    obj = Group.get_group(g._db, gid)
    members = Group.get_group_members(g._db, gid)
    for m in members:
        name = User.get_user_name(g.rds, appid, m['uid'])
        m['name'] = name if name else ''
        if not m.get('nickname'):
            m['nickname'] = ""
        
    obj['members'] = members

    q = User.get_group_do_not_disturb(g.rds, appid, uid, gid)
    obj['do_not_disturb'] = bool(q)

    resp = {"data":obj}
    return make_response(200, resp)
开发者ID:richmonkey,项目名称:gobelieve_api,代码行数:21,代码来源:client_group.py

示例5: get_groups

# 需要导入模块: from models.user import User [as 别名]
# 或者: from models.user.User import get_user_name [as 别名]
def get_groups():
    appid = request.appid
    uid = request.uid

    groups = Group.get_groups(g._imdb, appid, uid)
    fields = request.args.get("fields", '')

    fields = fields.split(",")
    for obj in groups:
        gid = obj['id']
        if "members" in fields:
            members = Group.get_group_members(g._imdb, gid)
            for m in members:
                name = User.get_user_name(g.rds, appid, uid)
                m['name'] = name if name else ''
            obj['members'] = members
     
        if "quiet" in fields:
            q = User.get_user_notification_quiet(g.rds, appid, uid, gid)
            obj['quiet'] = bool(q)
        
    resp = {"data":groups}
    return make_response(200, resp)
开发者ID:chenklet,项目名称:gobelieve_api,代码行数:25,代码来源:group.py


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