diff options
Diffstat (limited to 'procurement/api.py')
-rw-r--r-- | procurement/api.py | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/procurement/api.py b/procurement/api.py index 0419ce8..d1830c2 100644 --- a/procurement/api.py +++ b/procurement/api.py @@ -1,7 +1,7 @@ from rest_framework.generics import ListAPIView, RetrieveAPIView -from procurement.models import Component -from procurement.serializers import ComponentSerializer +from procurement.models import Component, Supplier +from procurement.serializers import ComponentSerializer, SupplierSerializer, SupplierComponentsSerializer class ComponentAPIList(ListAPIView): @@ -12,3 +12,15 @@ class ComponentAPIList(ListAPIView): class ComponentAPIRetrieve(RetrieveAPIView): queryset = Component.objects.all() serializer_class = ComponentSerializer + +class SupplierAPIList(ListAPIView): + queryset = Supplier.objects.filter(is_authorized=True) + serializer_class = SupplierSerializer + +class SupplierAPIRetrieve(RetrieveAPIView): + queryset = Supplier.objects.filter(is_authorized=True) + serializer_class = SupplierSerializer + +class SupplierAPIComponents(RetrieveAPIView): + queryset = Supplier.objects.filter(is_authorized=True) + serializer_class = SupplierComponentsSerializer |