2017-08-13 13:44:48 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
from __future__ import unicode_literals
|
|
|
|
|
|
|
|
from django.contrib.auth.models import User
|
|
|
|
from rest_framework import viewsets
|
|
|
|
|
2017-08-13 19:51:25 +00:00
|
|
|
from core.models import Baby, DiaperChange, Feeding, Sleep, TummyTime
|
|
|
|
from .serializers import (BabySerializer, DiaperChangeSerializer,
|
|
|
|
FeedingSerializer, SleepSerializer,
|
2017-08-13 19:05:44 +00:00
|
|
|
TummyTimeSerializer, UserSerializer,)
|
2017-08-13 14:48:16 +00:00
|
|
|
|
|
|
|
|
|
|
|
class BabyViewSet(viewsets.ModelViewSet):
|
|
|
|
queryset = Baby.objects.all()
|
|
|
|
serializer_class = BabySerializer
|
|
|
|
|
|
|
|
|
2017-08-13 19:51:25 +00:00
|
|
|
class DiaperChangeViewSet(viewsets.ModelViewSet):
|
|
|
|
queryset = DiaperChange.objects.all()
|
|
|
|
serializer_class = DiaperChangeSerializer
|
|
|
|
|
|
|
|
|
2017-08-13 15:59:14 +00:00
|
|
|
class FeedingViewSet(viewsets.ModelViewSet):
|
|
|
|
queryset = Feeding.objects.all()
|
|
|
|
serializer_class = FeedingSerializer
|
|
|
|
|
|
|
|
|
2017-08-13 14:48:16 +00:00
|
|
|
class SleepViewSet(viewsets.ModelViewSet):
|
|
|
|
queryset = Sleep.objects.all()
|
|
|
|
serializer_class = SleepSerializer
|
2017-08-13 15:59:14 +00:00
|
|
|
|
|
|
|
|
2017-08-13 19:05:44 +00:00
|
|
|
class TummyTimeViewSet(viewsets.ModelViewSet):
|
|
|
|
queryset = TummyTime.objects.all()
|
|
|
|
serializer_class = TummyTimeSerializer
|
|
|
|
|
|
|
|
|
2017-08-13 15:59:14 +00:00
|
|
|
class UserViewSet(viewsets.ModelViewSet):
|
|
|
|
queryset = User.objects.all()
|
|
|
|
serializer_class = UserSerializer
|