Runs black
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
''' media that is posted in the app '''
|
||||
""" media that is posted in the app """
|
||||
from django.db import models
|
||||
|
||||
from bookwyrm import activitypub
|
||||
@ -8,23 +8,25 @@ from . import fields
|
||||
|
||||
|
||||
class Attachment(ActivitypubMixin, BookWyrmModel):
|
||||
''' an image (or, in the future, video etc) associated with a status '''
|
||||
""" an image (or, in the future, video etc) associated with a status """
|
||||
|
||||
status = models.ForeignKey(
|
||||
'Status',
|
||||
on_delete=models.CASCADE,
|
||||
related_name='attachments',
|
||||
null=True
|
||||
"Status", on_delete=models.CASCADE, related_name="attachments", null=True
|
||||
)
|
||||
reverse_unfurl = True
|
||||
|
||||
class Meta:
|
||||
''' one day we'll have other types of attachments besides images '''
|
||||
""" one day we'll have other types of attachments besides images """
|
||||
|
||||
abstract = True
|
||||
|
||||
|
||||
class Image(Attachment):
|
||||
''' an image attachment '''
|
||||
""" an image attachment """
|
||||
|
||||
image = fields.ImageField(
|
||||
upload_to='status/', null=True, blank=True, activitypub_field='url')
|
||||
caption = fields.TextField(null=True, blank=True, activitypub_field='name')
|
||||
upload_to="status/", null=True, blank=True, activitypub_field="url"
|
||||
)
|
||||
caption = fields.TextField(null=True, blank=True, activitypub_field="name")
|
||||
|
||||
activity_serializer = activitypub.Image
|
||||
|
Reference in New Issue
Block a user