forked from mirrors/bookwyrm
Handle both Image and Document types
This commit is contained in:
parent
239d927e94
commit
7c85b554cf
3 changed files with 9 additions and 4 deletions
|
@ -5,7 +5,7 @@ import sys
|
|||
from .base_activity import ActivityEncoder, Signature, naive_parse
|
||||
from .base_activity import Link, Mention
|
||||
from .base_activity import ActivitySerializerError, resolve_remote_id
|
||||
from .image import Document
|
||||
from .image import Document, Image
|
||||
from .note import Note, GeneratedNote, Article, Comment, Quotation
|
||||
from .note import Review, Rating
|
||||
from .note import Tombstone
|
||||
|
|
|
@ -5,9 +5,14 @@ from .base_activity import ActivityObject
|
|||
|
||||
@dataclass(init=False)
|
||||
class Document(ActivityObject):
|
||||
""" image block """
|
||||
""" a document """
|
||||
|
||||
url: str
|
||||
name: str = ""
|
||||
type: str = "Document"
|
||||
id: str = None
|
||||
|
||||
@dataclass(init=False)
|
||||
class Image(Document):
|
||||
""" an image """
|
||||
type: str = "Image"
|
||||
|
|
|
@ -3,7 +3,7 @@ from dataclasses import dataclass, field
|
|||
from typing import Dict
|
||||
|
||||
from .base_activity import ActivityObject
|
||||
from .image import Document
|
||||
from .image import Image
|
||||
|
||||
|
||||
@dataclass(init=False)
|
||||
|
@ -28,7 +28,7 @@ class Person(ActivityObject):
|
|||
endpoints: Dict = None
|
||||
name: str = None
|
||||
summary: str = None
|
||||
icon: Document = field(default_factory=lambda: {})
|
||||
icon: Image = field(default_factory=lambda: {})
|
||||
bookwyrmUser: bool = False
|
||||
manuallyApprovesFollowers: str = False
|
||||
discoverable: str = False
|
||||
|
|
Loading…
Reference in a new issue