From 307ac359a24caf35dc0add658331c7cebc17a65f Mon Sep 17 00:00:00 2001 From: sahama Date: Mon, 5 Aug 2024 14:25:37 +0330 Subject: [PATCH] cleanup --- accounts/settings.py | 3 ++- apps/gooyal_oauth2/views/pages.py | 3 ++- templates/gooyal_oauth2/application_list.html | 22 +++++++++---------- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/accounts/settings.py b/accounts/settings.py index bd4d773..90514f4 100644 --- a/accounts/settings.py +++ b/accounts/settings.py @@ -27,6 +27,7 @@ SECRET_KEY = 'django-insecure-&+7fi$8#2!r=b6=^i_6surhka6!%uw1a+pz^m0qc!t_#6y=qr2 DEBUG = config('DEBUG', default=True, cast=bool) ALLOWED_HOSTS = ['*'] +PAGE_SIZE = 20 # Application definition @@ -107,7 +108,7 @@ REST_FRAMEWORK = { 'rest_framework.permissions.IsAuthenticated', ), 'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.PageNumberPagination', - 'PAGE_SIZE': 10, + 'PAGE_SIZE': PAGE_SIZE, "DEFAULT_SCHEMA_CLASS": "drf_spectacular.openapi.AutoSchema", } diff --git a/apps/gooyal_oauth2/views/pages.py b/apps/gooyal_oauth2/views/pages.py index baaaa25..d30ca88 100644 --- a/apps/gooyal_oauth2/views/pages.py +++ b/apps/gooyal_oauth2/views/pages.py @@ -1,3 +1,4 @@ +from django.conf import settings from django.contrib.auth.decorators import login_required from django.urls import resolve, reverse_lazy from django.utils.decorators import method_decorator @@ -54,7 +55,7 @@ class ApplicationDetailView(DetailView): class ApplicationListView(FilterMixin, ListView): model = Application template_name = "gooyal_oauth2/application_list.html" - paginate_by = 2 + paginate_by = settings.PAGE_SIZE filterset_class = ApplicationFilter def get_ordering(self): diff --git a/templates/gooyal_oauth2/application_list.html b/templates/gooyal_oauth2/application_list.html index c1057c5..ba050d2 100644 --- a/templates/gooyal_oauth2/application_list.html +++ b/templates/gooyal_oauth2/application_list.html @@ -12,7 +12,7 @@
- +
@@ -23,8 +23,8 @@ {% block content %} - - + + {% for obj in object_list %} @@ -37,17 +37,17 @@
- -
-
-
-
- -
- +
+{#
#} +{# #} +{#
#} +{# #} +{#
#} +{#
#} +{#
#}
name{% if request.GET.ordering and 'name' in request.GET.ordering %}{% endif %}client id{% if request.GET.ordering and 'client_id' in request.GET.ordering %}{% endif %}name{% if request.GET.ordering and 'name' in request.GET.ordering %}{% endif %}client id{% if request.GET.ordering and 'client_id' in request.GET.ordering %}{% endif %} actions