Normally I'd need to type out the model definitions for those N models
by hand inside models.py.
Is there a way to generate the N model definitions programatically
instead of manually?
Why not use the facilities for sharding that are built in?
Database routers [1] are designed to allow you to have a single model
definition, but decide which database connection is used at runtime
based on properties of the objects involved.
[1] http://docs.djangoproject.com/en/dev/topics/db/multi-db/#automatic-database-routing
Yours,
Russ Magee %-)