Use dataclasses to define activitypub (de)serialization (#177)
* Use dataclasses to define activitypub (de)serialization
This commit is contained in:
parent
2c0a07a330
commit
8bbf1fe252
46 changed files with 1449 additions and 1228 deletions
|
@ -1,9 +1,17 @@
|
|||
''' bring all the models into the app namespace '''
|
||||
import inspect
|
||||
import sys
|
||||
|
||||
from .book import Connector, Book, Work, Edition, Author
|
||||
from .shelf import Shelf, ShelfBook
|
||||
from .status import Status, Review, Comment, Quotation
|
||||
from .status import Favorite, Boost, Tag, Notification, ReadThrough
|
||||
from .user import User, UserFollows, UserFollowRequest, UserBlocks
|
||||
from .user import FederatedServer
|
||||
|
||||
from .import_job import ImportJob, ImportItem
|
||||
from .site import SiteSettings, SiteInvite
|
||||
|
||||
cls_members = inspect.getmembers(sys.modules[__name__], inspect.isclass)
|
||||
activity_models = {c[0]: c[1].activity_serializer for c in cls_members \
|
||||
if hasattr(c[1], 'activity_serializer')}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue