daily pastebin goal
63%
SHARE
TWEET

Untitled

a guest Jan 12th, 2018 57 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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
RAW Paste Data
Top