moviewyrm/bookwyrm/models/__init__.py

39 lines
1.2 KiB
Python
Raw Normal View History

2021-03-08 16:49:10 +00:00
""" bring all the models into the app namespace """
import inspect
import sys
2020-12-22 18:28:04 +00:00
from .book import Book, Work, Edition, BookDataModel
from .author import Author
2020-09-17 20:09:11 +00:00
from .connector import Connector
2020-03-07 06:56:44 +00:00
from .shelf import Shelf, ShelfBook
2021-01-31 05:00:36 +00:00
from .list import List, ListItem
from .status import Status, GeneratedNote, Comment, Quotation
from .status import Review, ReviewRating
from .status import Boost
from .attachment import Image
from .favorite import Favorite
from .notification import Notification
from .readthrough import ReadThrough, ProgressUpdate, ProgressMode
2021-01-16 16:18:54 +00:00
from .user import User, KeyPair, AnnualGoal
from .relationship import UserFollows, UserFollowRequest, UserBlocks
2021-03-09 01:16:59 +00:00
from .report import Report, ReportComment
2020-09-17 20:09:11 +00:00
from .federated_server import FederatedServer
from .import_job import ImportJob, ImportItem
2021-03-21 01:23:59 +00:00
from .site import SiteSettings, SiteInvite, PasswordReset, InviteRequest
cls_members = inspect.getmembers(sys.modules[__name__], inspect.isclass)
2021-03-08 16:49:10 +00:00
activity_models = {
c[1].activity_serializer.__name__: c[1]
for c in cls_members
if hasattr(c[1], "activity_serializer")
}
2020-12-30 21:14:16 +00:00
status_models = [
2021-03-08 16:49:10 +00:00
c.__name__ for (_, c) in activity_models.items() if issubclass(c, Status)
]