How to delete an object in modelViewset in DRF?
I am doing a project in DRF and using modelviewset,
my object has two boolean fields and two users as foreign keys,
now i want to show the object only to those users and if both of them set their correspond's boolean attribute to True then the object will be deleted
i'm handling the logic of some code in custompermissions.py but i dont know if to handle the deletion of the object in there too or in the view,
and since i need to verify if the current user is either one of the users i have some logic to do,
i dont know what type of request i should permit also becuase DELETE will delete the object and i need to delete only in case both values are true,
and i can do it in a get but then i will have to spllit the show and delete into 2 diffrent routs.
can someone recommend what is best for me to do?
i want to show and delete an object in a spcifec case