You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
13 lines
465 B
13 lines
465 B
from rest_framework import generics
|
|
from .serializers import CompanySerializer
|
|
from .models import Company
|
|
|
|
class CompanyList(generics.ListCreateAPIView):
|
|
queryset = Company.objects.all() # tell django how to retrieve all objects from the DB
|
|
serializer_class = CompanySerializer # tell django what serializer to use
|
|
|
|
class CompanyDetail(generics.RetrieveUpdateDestroyAPIView):
|
|
queryset = Company.objects.all()
|
|
serializer_class = CompanySerializer
|
|
|