diff --git a/apps/applications/api/ApplicationsList/__init__.py b/apps/applications/api/ApplicationsList/__init__.py index e69de29..6b274ab 100644 --- a/apps/applications/api/ApplicationsList/__init__.py +++ b/apps/applications/api/ApplicationsList/__init__.py @@ -0,0 +1 @@ +from .views import * diff --git a/apps/borrowers/api/BorrowersList/__init__.py b/apps/borrowers/api/BorrowersList/__init__.py new file mode 100644 index 0000000..6b274ab --- /dev/null +++ b/apps/borrowers/api/BorrowersList/__init__.py @@ -0,0 +1 @@ +from .views import * diff --git a/apps/borrowers/api/BorrowersList/serializers.py b/apps/borrowers/api/BorrowersList/serializers.py new file mode 100644 index 0000000..31bcece --- /dev/null +++ b/apps/borrowers/api/BorrowersList/serializers.py @@ -0,0 +1,11 @@ +from rest_framework import serializers +from apps.borrowers.models import Borrower + + +class BorrowersListSerializer(serializers.ModelSerializer): + class Meta: + model = Borrower + fields = "__all__" + + +__all__ = ("BorrowersListSerializer",) diff --git a/apps/borrowers/api/BorrowersList/views.py b/apps/borrowers/api/BorrowersList/views.py new file mode 100644 index 0000000..166a486 --- /dev/null +++ b/apps/borrowers/api/BorrowersList/views.py @@ -0,0 +1,14 @@ +from rest_framework.generics import ListAPIView +from rest_framework.permissions import IsAuthenticated + +from apps.borrowers.api.BorrowersList.serializers import BorrowersListSerializer +from apps.borrowers.models import Borrower + + +class BorrowersListAPIView(ListAPIView): + permission_classes = (IsAuthenticated,) + serializer_class = BorrowersListSerializer + queryset = Borrower.objects.all() + + +__all__ = ("BorrowersListAPIView",) diff --git a/apps/borrowers/api/__init__.py b/apps/borrowers/api/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/apps/loans/api/LoansList/__init__.py b/apps/loans/api/LoansList/__init__.py new file mode 100644 index 0000000..6b274ab --- /dev/null +++ b/apps/loans/api/LoansList/__init__.py @@ -0,0 +1 @@ +from .views import * diff --git a/apps/loans/api/LoansList/serializers.py b/apps/loans/api/LoansList/serializers.py new file mode 100644 index 0000000..cc91fa9 --- /dev/null +++ b/apps/loans/api/LoansList/serializers.py @@ -0,0 +1,11 @@ +from rest_framework import serializers +from apps.loans.models import Loan + + +class LoansListSerializer(serializers.ModelSerializer): + class Meta: + model = Loan + fields = "__all__" + + +__all__ = ("LoansListSerializer",) diff --git a/apps/loans/api/LoansList/views.py b/apps/loans/api/LoansList/views.py new file mode 100644 index 0000000..c6b8bde --- /dev/null +++ b/apps/loans/api/LoansList/views.py @@ -0,0 +1,14 @@ +from rest_framework.generics import ListAPIView +from rest_framework.permissions import IsAuthenticated + +from apps.loans.api.LoansList.serializers import LoansListSerializer +from apps.loans.models import Loan + + +class LoansListAPIView(ListAPIView): + permission_classes = (IsAuthenticated,) + serializer_class = LoansListSerializer + queryset = Loan.objects.all() + + +__all__ = ("LoansListAPIView",) diff --git a/apps/loans/api/__init__.py b/apps/loans/api/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/apps/loans/urls.py b/apps/loans/urls.py new file mode 100644 index 0000000..e69de29