1
0
Fork 0

Remove follow suggestion on request

This commit is contained in:
Mouse Reeve 2021-10-04 13:14:32 -07:00
commit 15105bda4f
4 changed files with 31 additions and 0 deletions

View file

@ -44,6 +44,7 @@ class BookDataModel(ObjectMixin, BookWyrmModel):
bnf_id = fields.CharField( # Bibliothèque nationale de France
max_length=255, blank=True, null=True, deduplication_field=True
)
links = fields.ManyToManyField("Link")
search_vector = SearchVectorField(null=True)
last_edited_by = fields.ForeignKey(
@ -104,6 +105,7 @@ class Book(BookDataModel):
objects = InheritanceManager()
field_tracker = FieldTracker(fields=["authors", "title", "subtitle", "cover"])
file_links = fields.ManyToManyField("FileLink")
if ENABLE_THUMBNAIL_GENERATION:
cover_bw_book_xsmall_webp = ImageSpecField(

17
bookwyrm/models/link.py Normal file
View file

@ -0,0 +1,17 @@
""" outlink data """
from .activitypub_mixin import CollectionItemMixin
from .base_model import BookWyrmModel
from . import fields
class Link(CollectionItemMixin, BookWyrmModel):
"""a link to a website"""
url = fields.CharField(max_length=255)
name = fields.CharField(max_length=255)
class FileLink(Link):
"""a link to a file"""
filetype = fields.CharField(max_length=5)
filetype_description = fields.CharField(max_length=100)