def get_all_blogs(): d = DBHelper() count, result = d.find("SELECT id, title, content, create_time from blog") blogs = [Blog(ID, title, content, create_time) for ID, title, content, create_time in result] return count, blogs
def get_todo_list(): db = DBHelper() count, result = db.find("SELECT id, text, status FROM todo") return [dict(Id = Id, text = text, status = status) for Id, text, status in result]