Activitypub serialize shelves
This commit is contained in:
parent
932b4abcfe
commit
45e5df388d
6 changed files with 58 additions and 4 deletions
|
@ -1,6 +1,7 @@
|
|||
''' puttin' books on shelves '''
|
||||
from django.db import models
|
||||
|
||||
from fedireads import activitypub
|
||||
from fedireads.utils.models import FedireadsModel
|
||||
|
||||
|
||||
|
@ -23,6 +24,10 @@ class Shelf(FedireadsModel):
|
|||
model_name = type(self).__name__.lower()
|
||||
return '%s/%s/%s' % (base_path, model_name, self.identifier)
|
||||
|
||||
@property
|
||||
def activitypub_serialize(self):
|
||||
return activitypub.get_shelf(self)
|
||||
|
||||
class Meta:
|
||||
unique_together = ('user', 'identifier')
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue