Django App that allows for the addition of databases on the fly and also the ability to query those database's tables through dynamically generated models.
Currently working:
- Create database model instances in running system.
- Inject them into the known connections as needed.
- Inspect to get any model class for a table of the dynamic database.
To Do:
- Create
content_typeinstances for each new model type.
Usage:
- Create instances of the
Databasemodel. - The
configfield of theDatabasemodel should be a json blob that resembles what you add to theDATABASESsetting insettings.py. - The
namefield is the key in theDATABASESstruture insettings.py - Once you have an instance of
Database, call it'sget_modelmethod with a name of a table from the database. It will return a Model class for you to work with.
It's a work in progress. Feel free to open an issue or submit a pull request. Use at your own risk.