coleifer/peewee — Issue #20: Selecting databases in Meta is very non-flexible
Author: Jonanin
Created: 2011-11-28 01:33:08+00:00
State: open

I don't know Django very well, but as far as I could tell, Django doesn't use the Meta class in models to select the database to use, and probably for a good reason?

I really like peewee, but I had to restructure some of my base application flow because all Peewee model classes have to have the database instance available immediately on class creation and in some global scope. The examples of course look fine, but for an application like mine that is larger and uses blueprints and all that, the Meta/inheritance system was a bit awkward to use.

do you think there's a way to just have a global bind variable? Like Elixir:

elixir.metadata.bind = "sqlite:///honleague.sqlite"

or any way to set the database object after the Model classes or created...