Created
June 30, 2020 21:00
-
-
Save sairamkrish/9c47dc9e0e546b7fb065147b8aa9d4ef to your computer and use it in GitHub Desktop.
alembic model autogeneration
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
Automatically add all models to __all__ | |
This is used in alembic while autogenerating database migration script. | |
''' | |
from os.path import dirname, basename, isfile, join | |
import glob | |
modules = glob.glob(join(dirname(__file__), "*.py")) | |
__all__ = [ basename(f)[:-3] for f in modules if isfile(f) and not f.endswith('__init__.py')] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment