diff --git a/bookwyrm/migrations/0012_status_images.py b/bookwyrm/migrations/0012_status_images.py new file mode 100644 index 00000000..3b440bfd --- /dev/null +++ b/bookwyrm/migrations/0012_status_images.py @@ -0,0 +1,19 @@ +# Generated by Django 3.0.7 on 2020-11-23 20:44 + +import bookwyrm.utils.fields +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('bookwyrm', '0011_auto_20201113_1727'), + ] + + operations = [ + migrations.AddField( + model_name='status', + name='images', + field=bookwyrm.utils.fields.ArrayField(base_field=models.ImageField(upload_to='status/'), default=list, size=None), + ), + ] diff --git a/bookwyrm/models/status.py b/bookwyrm/models/status.py index 1ed98515..50e46bd6 100644 --- a/bookwyrm/models/status.py +++ b/bookwyrm/models/status.py @@ -5,6 +5,7 @@ from django.db import models from model_utils.managers import InheritanceManager from bookwyrm import activitypub +from bookwyrm.utils.fields import ArrayField from .base_model import ActivitypubMixin, OrderedCollectionPageMixin from .base_model import ActivityMapping, BookWyrmModel, PrivacyLevels from .base_model import tag_formatter @@ -17,6 +18,10 @@ class Status(OrderedCollectionPageMixin, BookWyrmModel): mention_users = models.ManyToManyField('User', related_name='mention_user') mention_books = models.ManyToManyField( 'Edition', related_name='mention_book') + images = ArrayField( + models.ImageField(upload_to='status/'), + default=list + ) local = models.BooleanField(default=True) privacy = models.CharField( max_length=255, diff --git a/bookwyrm/status.py b/bookwyrm/status.py index 4baaed6d..c950f4ab 100644 --- a/bookwyrm/status.py +++ b/bookwyrm/status.py @@ -13,7 +13,7 @@ def delete_status(status): def create_status(activity): - ''' unfortunately, it's not QUITE as simple as deserialiing it ''' + ''' unfortunately, it's not QUITE as simple as deserializing it ''' # render the json into an activity object serializer = activitypub.activity_objects[activity['type']] activity = serializer(**activity)