channels.py 文件源码

python
阅读 29 收藏 0 点赞 0 评论 0

项目:webpush-channels 作者: webpush-channels 项目源码 文件源码
def retrieve_channel_information(request):
    channel_id = request.matchdict['channel_id']
    parent_id = '/channels/{}'.format(channel_id)

    registrations, count = request.registry.storage.get_all(
        collection_id=REGISTRATION_COLLECTION_ID,
        parent_id=parent_id)

    user_registered = [r for r in registrations if r['id'] == request.prefixed_userid]

    if not user_registered:
        raise httpexceptions.HTTPForbidden()

    return {"data": {
        "registrations": count,
        "push": 0
    }}


# Channel Registration views
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号