I would like to document a set of sqlalchemy database classes. I have followed this type of logic when coding these classes. In db.init.py, I have an init_model() function that establishes a database connection and binds it to the declarative_base. I then import that declarative_base in my db.objects.py and use it to autoload the tables from the database instance. Unfortunately, when I try to autodoc the db.objects, sphinx tries to do the import of db.objects and finds an unbound metadata since init_model was not called first. Any suggestions as to what to do here?
Share
Michael Bayer was nice enough to offer this potential solution:
https://groups.google.com/d/topic/sqlalchemy/lLR233kwHFw/discussion