Update progress with comments

This commit is contained in:
Mouse Reeve
2021-03-20 17:34:58 -07:00
parent 942c4a6664
commit daa0268eb3
5 changed files with 41 additions and 3 deletions

View File

@ -14,6 +14,7 @@ from .activitypub_mixin import ActivitypubMixin, ActivityMixin
from .activitypub_mixin import OrderedCollectionPageMixin
from .base_model import BookWyrmModel
from .fields import image_serializer
from .readthrough import ProgressMode
from . import fields
@ -229,6 +230,13 @@ class Comment(Status):
"Edition", on_delete=models.PROTECT, activitypub_field="inReplyToBook"
)
# this is it's own field instead of a foreign key to the progress update
# so that the update can be deleted without impacting the status
progress = models.IntegerField(validators=[MinValueValidator(0)], null=True, blank=True)
mode = models.CharField(
max_length=3, choices=ProgressMode.choices, default=ProgressMode.PAGE, null=True, blank=True
)
@property
def pure_content(self):
""" indicate the book in question for mastodon (or w/e) users """