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
评论列表
文章目录