Guest User

Untitled

a guest
Jan 12th, 2018
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. def get_models(path):
  2. try:
  3. module = __import__(path + '.models', {}, {}, [''])
  4. except ImportError:
  5. return
  6.  
  7. for name, obj in inspect.getmembers(module):
  8. if inspect.isclass(obj) and issubclass(obj, db.Document):
  9. yield name, obj
Add Comment
Please, Sign In to add comment