From 12d1f9fd979c11b9e3a3a89b1595b07569b88f79 Mon Sep 17 00:00:00 2001 From: workmai Date: Thu, 4 Oct 2018 12:14:39 -0600 Subject: Initial commit of the coding assignment base project --- procurement/api.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 procurement/api.py (limited to 'procurement/api.py') diff --git a/procurement/api.py b/procurement/api.py new file mode 100644 index 0000000..0419ce8 --- /dev/null +++ b/procurement/api.py @@ -0,0 +1,14 @@ +from rest_framework.generics import ListAPIView, RetrieveAPIView + +from procurement.models import Component +from procurement.serializers import ComponentSerializer + + +class ComponentAPIList(ListAPIView): + queryset = Component.objects.all() + serializer_class = ComponentSerializer + + +class ComponentAPIRetrieve(RetrieveAPIView): + queryset = Component.objects.all() + serializer_class = ComponentSerializer -- cgit v1.1