Defining the database tables
Within the world of Python MVC web frameworks, the database tables are the models. Used by the website to store data, they are generated with and modeled by Python classes. These classes subclass or inherit pre-written functionality from a superclass that contains a majority of the database management code, leaving us to simply define the columns of the table using basic data types such as strings and integers, as well as advanced classes such as geometries.
These class-defined tables can be generated in multiple RDBMS without the need to revamp how the model code is written. While GeoAlchemy2 only works on top of PostgreSQL/PostGIS, SQLAlchemy models can be used to generate tables in a variety of databases, including ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access