[Django]-How to access related object id in DeleteView

7👍

def post(self, request, *args, **kwargs):
    self.object = self.get_object() #Add this to load the object
    #Your code
    return HttpResponse(html)

PS: Please use Django template 😉

👤Mounir

Leave a comment