micro_service_placeholder/microService/api/TestAddress/view.py

11 lines
408 B
Python
Raw Permalink Normal View History

2024-11-30 05:34:13 +00:00
from rest_framework.viewsets import ModelViewSet
from api.TestAddress.model import Address
from api.TestAddress.serializer import AddressSerializer
from api.baseViewSet import BaseViewSet
class AddressViewset(BaseViewSet):
queryset = Address.objects.all().order_by('-timestamp')
serializer_class = AddressSerializer
filterset_fields = ['address', 'city']
search_fields = ['address', 'city']