Show all the posts, most recent first.
()
| 15 | |
| 16 | @bp.route("/") |
| 17 | def index(): |
| 18 | """Show all the posts, most recent first.""" |
| 19 | db = get_db() |
| 20 | posts = db.execute( |
| 21 | "SELECT p.id, title, body, created, author_id, username" |
| 22 | " FROM post p JOIN user u ON p.author_id = u.id" |
| 23 | " ORDER BY created DESC" |
| 24 | ).fetchall() |
| 25 | return render_template("blog/index.html", posts=posts) |
| 26 | |
| 27 | |
| 28 | def get_post(id, check_author=True): |
nothing calls this directly
no test coverage detected