DeleteView is a class within the django.views.generic module of the Django project.
django-oauth-toolkit (project website and PyPI package information) is a code library for adding and handling OAuth2 flows within your Django web application and API.
The django-oauth-toolkit project is open sourced under the FreeBSD license and it is maintained by the developer community group Jazzband.
django-oauth-toolkit / oauth2_provider / views / token.py
# token.py
from django.contrib.auth.mixins import LoginRequiredMixin
from django.urls import reverse_lazy
from django.views.generic import DeleteView, ListView
from ..models import get_access_token_model
class AuthorizedTokensListView(LoginRequiredMixin, ListView):
context_object_name = "authorized_tokens"
template_name = "oauth2_provider/authorized-tokens.html"
model = get_access_token_model()
def get_queryset(self):
return super().get_queryset().select_related("application").filter(
user=self.request.user
)
class AuthorizedTokenDeleteView(LoginRequiredMixin, DeleteView):
template_name = "oauth2_provider/authorized-token-delete.html"
success_url = reverse_lazy("oauth2_provider:authorized-token-list")
model = get_access_token_model()
def get_queryset(self):
return super().get_queryset().filter(user=self.request.user)
## ... source file continues with no further DeleteView examples...