This helps avoid issues where model classes are not evaluated. If the models are not properly imported then Sqlalchemy can explode during database initialization since the mapped columns have not yet been registered. Later, having the models all imported into __init__.py will help with setting up a test db since it will ensure that the registrations for all models is happening as the classes are evaluated during the imports in the package init file.
27 lines
682 B
Python
27 lines
682 B
Python
from .db import Base, CRUD, CRUDRepo, UpdateMissingEntryError, get_database
|
|
from .users import UserModel, UserRepoImpl
|
|
from .publication import (
|
|
PublicationEntryModel,
|
|
PublicationSequenceModel,
|
|
PublicationOrderModel,
|
|
PublicationModel,
|
|
PublicationRepoImpl,
|
|
)
|
|
from .subscription import SubscriptionModel, SubscriptionRepoImpl
|
|
|
|
__all__ = [
|
|
'Base',
|
|
'CRUD',
|
|
'CRUDRepo',
|
|
'UpdateMissingEntryError',
|
|
'get_database',
|
|
'UserModel',
|
|
'UserRepoImpl',
|
|
'PublicationEntryModel',
|
|
'PublicationSequenceModel',
|
|
'PublicationOrderModel',
|
|
'PublicationModel',
|
|
'PublicationRepoImpl',
|
|
'SubscriptionModel',
|
|
'SubscriptionRepoImpl',
|
|
]
|