utils.py 文件源码

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

项目:collect-social 作者: Data4Democracy 项目源码 文件源码
def setup_db(connection_string):
    db = dataset.connect(connection_string)

    pages = db['page']
    users = db['user']
    posts = db['post']
    comments = db['comment']
    interactions = db['interaction']

    users.create_index(['user_id'])
    posts.create_index(['post_id'])
    comments.create_index(['comment_id'])
    comments.create_index(['post_id'])
    interactions.create_index(['comment_id'])
    interactions.create_index(['post_id'])
    interactions.create_index(['user_id'])

    return db
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号