samedi 27 juin 2015

How does flask's sqlalchemy extension discover models

The flask sqlalchemy API offers a very convenient function called create_all(...) that creates a database and each table corresponding to my defined models.

How does the API know which models I have defined? I never instantiate or register an instance of the model. They're just class definitions that inherit from db.Model.

Aucun commentaire:

Enregistrer un commentaire