Serializing object full object in a notification
When implementing djangoldp#332, my plan is to add a step when receiving NotificationViewSet.create
(POST notification) which allows packages to configure "filters" on the notification. I.e. if the job-offer passed in the notification doesn't match my skills, then the viewset /users/x/inbox/
will ignore the notification
I think that this is a simple approach, it avoids messing with the activities system or changing the notification code too much, without creating any special case but allowing users to override this behaviour?
My issue was that the JobOffer
in the might not be local. Instead of implementing something that pulls the external JobOffer into the view code, I wanted to serialize the JobOffer at sending-time, with the skills
. So where a Notification is currently sent like so:
{
'object': 'https://my-server.com/job-offers/x/'
}
I want to enable sending:
{
'object': {
'@id': 'https://my-server.com/job-offers/x/',
'@type': 'hd:joboffer',
'skills': [ 'https://my-server.com/skills/x/' ]
}
}
I can then create a subscription on the container /job-offers/
with the flag object_serialization=True
. @jbpasquier does this seem OK to you?