Home / Function/ index() — flask Function Reference

index() — flask Function Reference

Architecture documentation for the index() function in blog.py from the flask codebase.

Entity Profile

Dependency Diagram

graph TD
  5cc1eaeb_60d2_2dca_a3a0_e22c6248cf23["index()"]
  bf08e60d_e030_cf15_e246_1de85afd9b5e["blog.py"]
  5cc1eaeb_60d2_2dca_a3a0_e22c6248cf23 -->|defined in| bf08e60d_e030_cf15_e246_1de85afd9b5e
  adc04a87_eacf_cc39_8808_98d7d38c7044["get_db()"]
  5cc1eaeb_60d2_2dca_a3a0_e22c6248cf23 -->|calls| adc04a87_eacf_cc39_8808_98d7d38c7044
  style 5cc1eaeb_60d2_2dca_a3a0_e22c6248cf23 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

examples/tutorial/flaskr/blog.py lines 17–25

def index():
    """Show all the posts, most recent first."""
    db = get_db()
    posts = db.execute(
        "SELECT p.id, title, body, created, author_id, username"
        " FROM post p JOIN user u ON p.author_id = u.id"
        " ORDER BY created DESC"
    ).fetchall()
    return render_template("blog/index.html", posts=posts)

Subdomains

Calls

Frequently Asked Questions

What does index() do?
index() is a function in the flask codebase, defined in examples/tutorial/flaskr/blog.py.
Where is index() defined?
index() is defined in examples/tutorial/flaskr/blog.py at line 17.
What does index() call?
index() calls 1 function(s): get_db.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free