def to_remove_activity(self, user): ''' AP for un-shelving a book''' return activitypub.Remove( id='%s#remove' % self.remote_id, actor=user.remote_id, object=self.book.to_activity(), target=self.shelf.to_activity() ).serialize()
def to_remove_activity(self, user): """AP for un-shelving a book""" collection_field = getattr(self, self.collection_field) return activitypub.Remove( id="{:s}#remove".format(collection_field.remote_id), actor=user.remote_id, object=self.to_activity_dataclass(), target=collection_field.remote_id, ).serialize()
def to_remove_activity(self): ''' AP for un-shelving a book''' object_field = getattr(self, self.object_field) collection_field = getattr(self, self.collection_field) return activitypub.Remove( id='%s#remove' % self.remote_id, actor=self.user.remote_id, object=object_field.to_activity(), target=collection_field.remote_id).serialize()
def to_remove_activity(self): """ AP for un-shelving a book""" object_field = getattr(self, self.object_field) collection_field = getattr(self, self.collection_field) return activitypub.Remove( id=self.remote_id, actor=self.user.remote_id, object=object_field, target=collection_field.remote_id, ).serialize()