serverside.py 文件源码

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

项目:SlackRU 作者: HackRU 项目源码 文件源码
def get_db():
    """
    From the Flask Websitei, probs best practice to connect to the databse this way
    """
    db = getattr(g, '_database', None)
    if db is None:
        db = g._database = sqlite3.connect(dbpath)
    def make_dicts(cursor, row):
        return dict((cursor.description[idx][0], value)
                    for idx, value in enumerate(row))

    db.row_factory = make_dicts
    return db
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号