Flask/Sql Alchemy

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/20

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 10:35 AM on 11/30/25
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

21 Terms

1
New cards
Model-View-Controller (MVC) Pattern
A software design pattern that divides an application into three interconnected components: Model (data/logic), View (user interface), and Controller (input handling). Metaphor: Think of a restaurant. The Model is the Kitchen (prepares food/data). The View is the Dining Room and Menu (presents food to customers). The Controller is the Waiter (takes orders, tells kitchen, serves food).
2
New cards
Model (in MVC)
Manages data, logic, rules, and often data storage for an application. Metaphor: The brain of the application, holding all the important facts and rules.
3
New cards
View (in MVC)
Presents information to users using HTML/CSS and collects user input. Metaphor: The display screen or storefront, showing things to the user and collecting their input.
4
New cards
Controller (in MVC)
Accepts user input and interacts with both the Model and the View. Metaphor: The traffic cop directing user requests to the right place and getting responses back.
5
New cards
Flask Framework
A minimalistic Python framework designed for building web applications, known for its simplicity and extensibility. Metaphor: A basic toolkit for quickly building websites in Python.
6
New cards
ORM (Object-Relational Mapper)
A library (like SQLAlchemy) that allows developers to interact with a database using object-oriented code instead of raw SQL queries. Metaphor: A translator that converts database language (SQL) into your programming language (Python objects) and vice-versa, so you don't have to speak SQL directly.
7
New cards
Model Declaration (Flask/SQLAlchemy)
Defining how database models are structured using Python classes, where class attributes are mapped to database columns. Metaphor: Creating a blueprint for a type of data, specifying what information it will hold (like a contact list template: name, phone, email).
8
New cards
CRUD Operations
The four fundamental operations for persistent storage: Create, Read (Query), Update, and Delete. Metaphor: The four fundamental ways you interact with a filing cabinet: putting in new files (Create), finding existing files (Read), changing information on a file (Update), and throwing out old files (Delete).
9
New cards
Jinja Templates
A templating engine commonly used in Flask to create dynamic HTML views by embedding variables, loops, and conditional logic. Metaphor: A customizable form letter. You have a standard letter (template) with blank spaces (variables) where you can plug in specific names, dates, or even entire paragraphs based on conditions.
10
New cards
Controller Functions
Functions or methods in Flask that are responsible for handling incoming HTTP requests and generating HTTP responses. Metaphor: The reception desk at a hotel. It takes incoming requests from guests, figures out what they need, and prepares the appropriate response.
11
New cards
Routing (Flask)
The process of mapping specific URLs (HTTP requests) to their corresponding controller functions using decorators. Metaphor: The GPS system of your web application. When a user types a URL, routing guides that request to the exact function designed to handle that specific URL.
12
New cards
Form Submission
The act of sending user-entered data from an HTML form to the server, typically as encapsulated name-value pairs within an HTTP request. Metaphor: Filling out an order form and handing it to the cashier. All the information you wrote down is grouped together and sent.
13
New cards
`request` object (Flask)
A Flask object used within controller functions to access data from an incoming HTTP request, such as form parameters, query strings, and headers. Metaphor: The waiter's notepad. When a customer gives an order (form submission), the waiter (controller function) uses this notepad (request object) to read all the details of the order.
14
New cards
Mapped attributes (SQLAlchemy)
Declarations within a Python model class that define the type, nullability, and role of database columns. Metaphor: Labeling each box in your filing cabinet. You're specifying 'this box holds names,' 'that box holds dates,' and 'this one can be empty.'
15
New cards
Relationships (SQLAlchemy)
Definitions that link different database tables (and their corresponding Python models), establishing how data relates, such as a one-to-many relationship. Metaphor: Family ties between people. One parent (table) can have many children (another table), and you define how they are connected.
16
New cards
Building Queries (SQLAlchemy)
The process of constructing database queries by selecting models, applying conditions (`.filter()`), and sorting results (`.order_by()`) to retrieve specific data. Metaphor: Telling a librarian exactly what book you want: 'I need a sci-fi book, written by 'X', published after 2000, and sort them by title.'
17
New cards
Jinja Expressions `{{ }}`
Used in Jinja templates to embed variables, Python expressions, or function calls, whose evaluated result is then displayed in the HTML output. Metaphor: A 'fill-in-the-blank' section in a document. Whatever value is inside the curly braces gets printed directly onto the page.
18
New cards
Jinja Control Flow `{% %}`
Used in Jinja templates for programming logic such as loops (`for`) and conditional statements (`if/else`), which control how content is structured or rendered. Metaphor: The director's instructions in a play. These tags tell the template, 'If this condition is true, show this scene,' or 'Repeat this line for each character.'
19
New cards
Template Inheritance (Jinja)
A feature allowing base templates to define a common page structure (e.g., header, footer), which can then be extended by other templates that override or add content to specific 'blocks'. Metaphor: A family recipe. The main recipe (base template) has sections like 'ingredients' and 'instructions'. Individual family members can adapt specific sections (blocks) like 'secret ingredient' while keeping the rest standard.
20
New cards
Template Inclusion (Jinja)
The ability to insert reusable smaller template files (like a navigation bar or footer) directly into other templates. Metaphor: Building with LEGOs. You have a pre-built small car or tree (included template) that you can easily drop into any of your larger LEGO creations.
21
New cards
Relative Paths
URLs that specify a path to a resource in relation to the current document's location, rather than an absolute URL. Enhances maintainability and portability. Metaphor: Giving directions like 'turn left at the next corner' instead of 'go to 123 Main Street, Anytown, USA.' It's based on where you currently are.