I am creating the following event system / signup using the Django REST Framework and cannot figure out how to configure it correctly.
In my event model, I have:
followers = models.ManyToManyField(get_user_model(), related_name='following')
Ideally, an authenticated user can use POST or PATCH to add or remove followers from a record for a given event. Although I'm not quite sure what the best way to do this.
My current thinking was to create a serializer that provides only a follower field, and then create an APIView using this serializer with the login in the get and post / patch methods to add or remove a specific user.
I get the feeling that this makes the situation too complicated. Is there an easier way to do this?
source
share