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.
12 lines
471 B
12 lines
471 B
from rest_framework import generics
|
|
from .serializers import LocationSerializer
|
|
from .models import Location
|
|
|
|
class LocationList(generics.ListCreateAPIView):
|
|
queryset = Location.objects.all() # tell django how to retrieve all objects from the DB
|
|
serializer_class = LocationSerializer # tell django what serializer to use
|
|
|
|
class LocationDetail(generics.RetrieveUpdateDestroyAPIView):
|
|
queryset = Location.objects.all()
|
|
serializer_class = LocationSerializer
|