Why One Table Needs Several Models, and the Idea PEP 827 Offers
What the Language Summit write-up says each CRUD operation needs from a model, and the idea PEP 827 offers for keeping them in step.
For: Learners new to web backends.
Several models for one table
Another use-case PEP 827 serves is generating new types programmatically, such as for CRUD (Create, Read, Update, Delete) web applications, where a single database table typically has a separate ORM model definition for each CRUD operation.[1]
Keeping all of these models and parameters up-to-date with the database model requires lots of diligence and can’t usually be done programmatically.[1]
What each operation needs
Create would require all properties without defaults, Read would include all the public properties of a model, and Update would make all properties optional (supporting the PATCH HTTP method).[1]
Delete doesn’t typically need a model, as only the primary key is needed to delete a record.[1]
The idea PEP 827 offers
So what if there was a way to instead contain the complexity within a type that transforms the overall model type for each of the CRUD operations?[1]
The PEP was also designed so that no new keywords would be required to adopt it.[1]
Sources
- PEP 827: Type Manipulation (Python Language Summit 2026) (blog.python.org · checked )
More articles
- LearningWhy Rust for CPython, and What It Will Not FixThe reasons the Language Summit 2026 write-up gives for proposing Rust in CPython, what it says Rust does not remove and how the team proposes to reduce the risk.
- LearningWhat the GIL, Subinterpreters and Free-Threading Each Give UpWhat the Python Language Summit 2026 write-up says each of Python's three concurrency models gives up, and why it calls threads a hard interface.
- LearningHow a Username and Any API Key Became Admin AccessWhat the Python Security Response Team says was reported, what supplying an admin username with any key did and how quickly the fix was confirmed.