Adds quotes

This commit is contained in:
Mouse Reeve
2020-04-08 09:40:47 -07:00
parent 5b7f29c45b
commit a88cf2b6dd
16 changed files with 190 additions and 7 deletions

View File

@ -1,6 +1,7 @@
''' bring all the models into the app namespace '''
from .book import Connector, Book, Work, Edition, Author
from .shelf import Shelf, ShelfBook
from .status import Status, Review, Comment, Favorite, Boost, Tag, Notification
from .status import Status, Review, Comment, Quotation
from .status import Favorite, Boost, Tag, Notification
from .user import User, UserFollows, UserFollowRequest, UserBlocks
from .user import FederatedServer

View File

@ -56,6 +56,17 @@ class Comment(Status):
super().save(*args, **kwargs)
class Quotation(Status):
''' like a review but without a rating and transient '''
book = models.ForeignKey('Edition', on_delete=models.PROTECT)
quote = models.TextField()
def save(self, *args, **kwargs):
self.status_type = 'Quotation'
self.activity_type = 'Note'
super().save(*args, **kwargs)
class Review(Status):
''' a book review '''
name = models.CharField(max_length=255, null=True)