From cc15a5be6d97be57b17417c98f49ce6c226b6901 Mon Sep 17 00:00:00 2001 From: Shavkatjon Odamboyev <153182519+Shavkatjon-O@users.noreply.github.com> Date: Thu, 12 Sep 2024 12:49:47 +0500 Subject: [PATCH] feat: applications list view --- .../api/ApplicationsList/__init__.py | 0 .../api/ApplicationsList/serializers.py | 11 +++++++++++ apps/applications/api/ApplicationsList/views.py | 16 ++++++++++++++++ apps/applications/api/__init__.py | 0 apps/applications/urls.py | 0 5 files changed, 27 insertions(+) create mode 100644 apps/applications/api/ApplicationsList/__init__.py create mode 100644 apps/applications/api/ApplicationsList/serializers.py create mode 100644 apps/applications/api/ApplicationsList/views.py create mode 100644 apps/applications/api/__init__.py create mode 100644 apps/applications/urls.py diff --git a/apps/applications/api/ApplicationsList/__init__.py b/apps/applications/api/ApplicationsList/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/apps/applications/api/ApplicationsList/serializers.py b/apps/applications/api/ApplicationsList/serializers.py new file mode 100644 index 0000000..aa8363c --- /dev/null +++ b/apps/applications/api/ApplicationsList/serializers.py @@ -0,0 +1,11 @@ +from rest_framework import serializers +from apps.applications.models import Application + + +class ApplicationsListSerializer(serializers.ModelSerializer): + class Meta: + model = Application + fields = "__all__" + + +__all__ = ("ApplicationsListSerializer",) diff --git a/apps/applications/api/ApplicationsList/views.py b/apps/applications/api/ApplicationsList/views.py new file mode 100644 index 0000000..702db59 --- /dev/null +++ b/apps/applications/api/ApplicationsList/views.py @@ -0,0 +1,16 @@ +from rest_framework.generics import ListAPIView +from rest_framework.permissions import IsAuthenticated + +from apps.applications.api.ApplicationsList.serializers import ( + ApplicationsListSerializer, +) +from apps.applications.models import Application + + +class ApplicationsListAPIView(ListAPIView): + permission_classes = (IsAuthenticated,) + serializer_class = ApplicationsListSerializer + queryset = Application.objects.all() + + +__all__ = ("ApplicationsListAPIView",) diff --git a/apps/applications/api/__init__.py b/apps/applications/api/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/apps/applications/urls.py b/apps/applications/urls.py new file mode 100644 index 0000000..e69de29