Sort domains in admin view

This commit is contained in:
Mouse Reeve 2022-01-17 08:14:13 -08:00
parent e218b73272
commit b9fde85b49

View file

@ -20,9 +20,9 @@ class LinkDomain(View):
def get(self, request, status="pending"):
"""view pending domains"""
data = {
"domains": models.LinkDomain.objects.filter(status=status).prefetch_related(
"links"
),
"domains": models.LinkDomain.objects.filter(status=status)
.prefetch_related("links")
.order_by("-created_date"),
"counts": {
"pending": models.LinkDomain.objects.filter(status="pending").count(),
"approved": models.LinkDomain.objects.filter(status="approved").count(),