carom-server/billard/views.py
2017-01-09 20:42:59 +01:00

34 lines
827 B
Python

from billard.serializers import *
from .models import LocationData
from rest_framework import viewsets
from django.views import generic
from django.views.generic.detail import DetailView
class ClientViewSet(viewsets.ModelViewSet):
queryset = Client.objects.all()
serializer_class = ClientSerializer
class LocationViewSet(viewsets.ModelViewSet):
queryset = Location.objects.all()
serializer_class = LocationSerializer
class TableViewSet(viewsets.ModelViewSet):
queryset = Table.objects.all()
serializer_class = TableSerializer
class LocationDataViewSet(viewsets.ModelViewSet):
queryset = LocationData.objects.all()
serializer_class = LocationDataSerializer
class IndexView(generic.ListView):
model = LocationData
class LocationDataDetailView(DetailView):
model = LocationData