views:

217

answers:

1

I'm trying to figure out how I can use the type() module to dynamically create a Django model based on existing DB tables without having to either write it out manually or use the manage.py generator to inspect the DB. Reason is my schema changes frequently -- adding new tables, adding/deleting columns, etc. Anyone have a good solution? Something similar to this would be awesome: http://www.b-list.org/weblog/2008/nov/09/dynamic-forms/

+1  A: 

You can look at inspectdb code, and instead of outputting code return classes.

Dmitry Shevchenko