I have a ListView and DeleteView
class MyDeleteView(DeleteView): success_url = reverse('list')
I want the option to delete items in a ListView. I know how to do this if I accept a confirmation page in DeleteView, but I do not want my DeleteView to have no template. I just want to delete the item and send back the user.
I guess it should be with POST options, but what should the HTML look like? I think this is something like:
<form method="post" action="/delete/"> <ul> <li>Item1 (<input type="submit" value="Delete" />)</li> <li>Item2 (<input type="submit" value="Delete" />)</li> <li>Item3 (<input type="submit" value="Delete" />)</li> </ul> </form>
Can someone lead me in the right direction? Thanks.
source share