Use edit date to track is status has been updated

This commit is contained in:
Mouse Reeve 2021-10-15 08:56:07 -07:00
parent 20cca69f06
commit b11b810ec9
3 changed files with 9 additions and 5 deletions

View file

@ -35,6 +35,7 @@ class Note(ActivityObject):
tag: List[Link] = field(default_factory=lambda: [])
attachment: List[Document] = field(default_factory=lambda: [])
sensitive: bool = False
updated: str = None
type: str = "Note"

View file

@ -1,6 +1,7 @@
# Generated by Django 3.2.5 on 2021-10-15 00:28
# Generated by Django 3.2.5 on 2021-10-15 15:54
from django.db import migrations, models
import bookwyrm.models.fields
from django.db import migrations
class Migration(migrations.Migration):
@ -12,7 +13,7 @@ class Migration(migrations.Migration):
operations = [
migrations.AddField(
model_name="status",
name="edited",
field=models.BooleanField(default=False),
name="edited_date",
field=bookwyrm.models.fields.DateTimeField(blank=True, null=True),
),
]

View file

@ -43,7 +43,9 @@ class Status(OrderedCollectionPageMixin, BookWyrmModel):
published_date = fields.DateTimeField(
default=timezone.now, activitypub_field="published"
)
edited = models.BooleanField(default=False)
edited_date = fields.DateTimeField(
blank=True, null=True, activitypub_field="updated"
)
deleted = models.BooleanField(default=False)
deleted_date = models.DateTimeField(blank=True, null=True)
favorites = models.ManyToManyField(