Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def get_models(path):
- try:
- module = __import__(path + '.models', {}, {}, [''])
- except ImportError:
- return
- for name, obj in inspect.getmembers(module):
- if inspect.isclass(obj) and issubclass(obj, db.Document):
- yield name, obj
Add Comment
Please, Sign In to add comment