database.py 文件源码

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

项目:odrs-web 作者: GNOME 项目源码 文件源码
def user_get_all(self):
        """ Get all the users on the system """
        try:
            cur = self._db.cursor()
            cur.execute("SELECT user_id, date_created, "
                        "user_hash, karma, is_banned "
                        "FROM users ORDER BY user_id DESC;")
        except mdb.Error as e:
            raise CursorError(cur, e)
        res = cur.fetchall()
        if not res:
            return []
        users = []
        for e in res:
            users.append(_create_user(e))
        return users
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号