Пример #1
0
 def to_add_activity(self):
     ''' AP for shelving a book'''
     object_field = getattr(self, self.object_field)
     collection_field = getattr(self, self.collection_field)
     return activitypub.Add(id='%s#add' % self.remote_id,
                            actor=self.user.remote_id,
                            object=object_field.to_activity(),
                            target=collection_field.remote_id).serialize()
Пример #2
0
 def to_add_activity(self, user):
     ''' AP for shelving a book'''
     return activitypub.Add(
         id='%s#add' % self.remote_id,
         actor=user.remote_id,
         object=self.book.local_id,
         target=self.shelf.remote_id,
     ).serialize()
Пример #3
0
 def to_add_activity(self, user):
     """AP for shelving a book"""
     collection_field = getattr(self, self.collection_field)
     return activitypub.Add(
         id="{:s}#add".format(collection_field.remote_id),
         actor=user.remote_id,
         object=self.to_activity_dataclass(),
         target=collection_field.remote_id,
     ).serialize()
Пример #4
0
 def to_add_activity(self):
     """ AP for shelving a book"""
     object_field = getattr(self, self.object_field)
     collection_field = getattr(self, self.collection_field)
     return activitypub.Add(
         id=self.remote_id,
         actor=self.user.remote_id,
         object=object_field,
         target=collection_field.remote_id,
     ).serialize()