588825332f
I took the serializers and put them in their own file. I made the due dates be attached to the project with a foreign key, rather than M2M, better admin inline.
19 lines
581 B
Python
19 lines
581 B
Python
__author__ = 'tyrel'
|
|
from rest_framework import viewsets
|
|
from project.models import Project, Category, DueDate
|
|
from project.api.serializers import ProjectSerializer, CategorySerializer, DueDateSerializer
|
|
|
|
|
|
class ProjectViewSet(viewsets.ModelViewSet):
|
|
queryset = Project.objects.all()
|
|
serializer_class = ProjectSerializer
|
|
|
|
|
|
class CategoryViewSet(viewsets.ModelViewSet):
|
|
queryset = Category.objects.all()
|
|
serializer_class = CategorySerializer
|
|
|
|
|
|
class DueDateViewSet(viewsets.ModelViewSet):
|
|
queryset = DueDate.objects.all()
|
|
serializer_class = DueDateSerializer |