Delete Request

Report a typo

The service we're creating is used for TODO lists. Implement the delete method for removing tasks.

The name of a task is passed in query as a parameter todo. Remove this task from all_todos list if it's present.

The response should be a redirection to the "/" page.

Write a program in Python 3
from django.shortcuts import redirect
from django.views import View


class TodoView(View):
all_todos = []

def delete(self, request, todo, *args, **kwargs):
...
___

Create a free account to access the full topic