How to do deferred engine selection?
I am now monkey-patching my models (see issue mentioned above). Would be great if we could come up with a less 'hacky' solutions, though.
 Check out these docs: http://peewee.readthedocs.org/en/latest/peewee/cookbook.html#dynamically-defining-a-database
 Ah. D'oh. Thank you. Works like a charm.
 Link http://peewee.readthedocs.org/en/latest/peewee/cookbook.html#dynamically-defining-a-database doesn't exist anymore. Can you help? * http://docs.peewee-orm.com/en/latest/peewee/database.html#run-time-database-configuration
* http://docs.peewee-orm.com/en/latest/peewee/database.html#dynamically-defining-a-database Thank you,

works very well!
Regards / Liebe Grüße,

Ralph Mueller

Annastrasse 44, 64673 Zwingenberg
Mobile: +49 177 449 0460
Office: +49 6251 789545
email: ralph.mueller.de@gmail.com <mailto:ralph.mueller.de@gmail.com>
https://www.ralph-mueller.net <https://www.ralph-mueller.net/>



> Am 15.03.2018 um 14:51 schrieb Charles Leifer <notifications@github.com>:
> 
> http://docs.peewee-orm.com/en/latest/peewee/database.html#run-time-database-configuration <http://docs.peewee-orm.com/en/latest/peewee/database.html#run-time-database-configuration>
> http://docs.peewee-orm.com/en/latest/peewee/database.html#dynamically-defining-a-database <http://docs.peewee-orm.com/en/latest/peewee/database.html#dynamically-defining-a-database>
> —
> You are receiving this because you commented.
> Reply to this email directly, view it on GitHub <https://github.com/coleifer/peewee/issues/365#issuecomment-373382277>, or mute the thread <https://github.com/notifications/unsubscribe-auth/ADTj_Fu6e-McLX3HmyYyH7Pm9bsnFbHRks5tenHggaJpZM4CABL7>.
> 


How can one do deferred engine selection?

For example, if I use a class similarly as `Database` of `flask-peewee`, I would like to select the engine/configure peewee after creation of the instance (ie, the commong `init_app()` approach). Unfortunately, all my models need to know their baseclass to reference the database. Is there any way around this? Can I change the database in the baseclass?

This is related to https://github.com/coleifer/flask-peewee/issues/69
