You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
424 B
Python
16 lines
424 B
Python
2 years ago
|
from django.shortcuts import render
|
||
|
|
||
|
# Create your views here.
|
||
|
from rest_framework import viewsets
|
||
2 years ago
|
from app.models import TP
|
||
|
from app.serializers import SerialMyModel
|
||
2 years ago
|
from django_filters.rest_framework import DjangoFilterBackend
|
||
|
|
||
|
|
||
|
|
||
|
class ModelQuery(viewsets.ModelViewSet):
|
||
|
queryset = TP.objects.all()
|
||
|
serializer_class = SerialMyModel
|
||
|
|
||
|
filter_backends = [DjangoFilterBackend]
|
||
|
filterset_fields = ('police_id',)
|