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


Python User.view方法代码示例

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


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

示例1: deleted_users

# 需要导入模块: from mygpo.users.models import User [as 别名]
# 或者: from mygpo.users.models.User import view [as 别名]
def deleted_users():
    from mygpo.users.models import User
    users = User.view('users/deleted',
            include_docs = True,
            reduce       = False,
        )
    return list(users)
开发者ID:fk-lx,项目名称:mygpo,代码行数:9,代码来源:user.py

示例2: handle

# 需要导入模块: from mygpo.users.models import User [as 别名]
# 或者: from mygpo.users.models.User import view [as 别名]
    def handle(self, *args, **options):

        users = User.view("users/deleted", include_docs=True, reduce=False)

        total = User.view("users/deleted", reduce=True)

        total = list(total)[0]["value"] if total else 0

        for n, user in enumerate(users):

            if user.is_active or not user.deleted:
                print "skipping", user.username

            print "deleting", user.username,
            user.delete()

            progress(n + 1, total)
开发者ID:Mic92,项目名称:mygpo,代码行数:19,代码来源:cleanup-unused-users.py

示例3: user_agent_stats

# 需要导入模块: from mygpo.users.models import User [as 别名]
# 或者: from mygpo.users.models.User import view [as 别名]
def user_agent_stats():
    from mygpo.users.models import User
    res = User.view('clients/by_ua_string',
        wrap_doc    = False,
        group_level = 1,
        stale       = 'update_after',
    )

    return Counter(dict((r['key'], r['value']) for r in res))
开发者ID:fk-lx,项目名称:mygpo,代码行数:11,代码来源:user.py

示例4: get_entries

# 需要导入模块: from mygpo.users.models import User [as 别名]
# 或者: from mygpo.users.models.User import view [as 别名]
    def get_entries(self):
        if self._useragents is None:
            res = User.view('clients/by_ua_string',
                wrap_doc    = False,
                group_level = 1,
                stale       = 'update_after',
            )

            self._useragents = Counter(dict((r['key'], r['value']) for r in res))

        return self._useragents
开发者ID:Mic92,项目名称:mygpo,代码行数:13,代码来源:clients.py

示例5: user_by_google_email

# 需要导入模块: from mygpo.users.models import User [as 别名]
# 或者: from mygpo.users.models.User import view [as 别名]
def user_by_google_email(email):
    """ Get a user by its connected Google account """

    from mygpo.users.models import User
    users = User.view('users/by_google_email',
            key          = email,
            include_docs = True,
        )

    if not users:
        return None

    return users.one()
开发者ID:fk-lx,项目名称:mygpo,代码行数:15,代码来源:user.py

示例6: deleted_user_count

# 需要导入模块: from mygpo.users.models import User [as 别名]
# 或者: from mygpo.users.models.User import view [as 别名]
def deleted_user_count():
    from mygpo.users.models import User
    total = User.view('users/deleted',
            reduce = True,
        )
    return list(total)[0]['value'] if total else 0
开发者ID:fk-lx,项目名称:mygpo,代码行数:8,代码来源:user.py


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