views.py 424 Bytes
Newer Older
Ben Waters's avatar
Ben Waters committed
1
from django.shortcuts import render
Ben Waters's avatar
Ben Waters committed
2 3 4 5
from rest_framework import viewsets
from rest_framework import permissions

from .models import Location, LocationSerializer
Ben Waters's avatar
Ben Waters committed
6 7

# Create your views here.
Ben Waters's avatar
Ben Waters committed
8 9 10 11 12 13 14
class LocationViewSet(viewsets.ModelViewSet):
	queryset = Location.objects.all()
    serializer_class = LocationSerializer
    permission_classes = (permissions.IsAuthenticatedOrReadOnly,
                          IsOwnerOrReadOnly,)