I've begin building a web application using Flask and Flask-SQLAlchemy. My experience with building web applications is very limited so I apologize before hand if I am being ambiguous.
The database for the web application is already built by another program running on the server. So all the tables are already predefined in the database. My web app and the other program running on the server will have read & write access to the database.
Recently I've decided to restructure my application and cater toward the model-view-controller schema, similar to Django, and to use blueprints for making things more manageable and neater. Similar to this https://github.com/mitsuhiko/flask/wiki/Large-app-how-to
...
app_name/
model.py
view.py
controller.py
__init__.py
...
So I've done a few tutorials and read up on Flask-SQLAlchemy but what I can't make sense for the life of me is how do I define my models in the application if my database is already predefined by another program??. and How can I use the SQLAlchemy ORM with a predefined database?
Previously, before I decided to restructure, I just used Pyhton's sqlite3 library for grabbing stuff from the database and displaying it on the web page. It wasn't to pretty and the way I was structuring things things would have gotten out of hand fast.