Created
September 30, 2019 06:19
-
-
Save moeinserpico/97cec4ea94b5631de967717a2e5f8d30 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.shortcuts import render | |
from rest_framework import viewsets | |
from .serializers import * | |
from .models import * | |
class EmployeeAPI(viewsets.ModelViewSet): | |
serializer_class = EmployeeSerializer | |
queryset = Employees.objects.all()[:5] | |
class DepartmentsAPI(viewsets.ModelViewSet): | |
serializer_class = DepartmentsSerializer | |
queryset = Departments.objects.all()[:5] | |
class DeptManagerAPI(viewsets.ModelViewSet): | |
serializer_class = DeptManagerSerializer | |
queryset = DeptManager.objects.all()[:5] | |
class DeptEmpAPI(viewsets.ModelViewSet): | |
serializer_class = DeptEmpSerializer | |
queryset = DeptEmp.objects.all()[:5] | |
class SalariesAPI(viewsets.ModelViewSet): | |
serializer_class = SalariesSerializer | |
queryset = Salaries.objects.all()[:5] | |
class TitlesAPI(viewsets.ModelViewSet): | |
serializer_class = TitlesSerializers | |
queryset = Titles.objects.all()[:5] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment