| 1 |
from rest_framework import viewsets |
| 2 |
from rest_framework.pagination import BasePagination |
| 3 |
|
| 4 |
from .models import Identity, Person |
| 5 |
from .serializers import IdentitySerializer, PersonSerializer |
| 6 |
|
| 7 |
|
| 8 |
class UnknownPagination(BasePagination): |
| 9 |
paginator_query_args = ["unknown_paginator"] |
| 10 |
|
| 11 |
|
| 12 |
class PersonViewSet(viewsets.ModelViewSet): |
| 13 |
model = Person |
| 14 |
queryset = Person.objects |
| 15 |
serializer_class = PersonSerializer |
| 16 |
pagination_class = UnknownPagination |
| 17 |
|
| 18 |
|
| 19 |
class IdentityViewSet(viewsets.ModelViewSet): |
| 20 |
model = Identity |
| 21 |
queryset = Identity.objects |
| 22 |
serializer_class = IdentitySerializer |