Model
PronunciationMOD-ul
Definition
In an ORM, a model is a class that describes a database table: its fields become columns and each instance is a row.
Where you hear it
In Django and SQLAlchemy code, models.py files, and migration discussions.
Examples
Add a
due_datefield to the Payment model.Changing a model means creating a migration.
The Payment model has a status field with three possible values.
Common mistake
Using it for any data object. A model is tied to a table; a plain class or dataclass is not.
Don't confuse with
A data model, which is the overall design of the data. A model is one class inside that design.
Say it at work
- In a meeting or chat
Which model owns this field?
- In an email or ticket
Keep the model thin; put rules in services.