11 lines
408 B
Python
11 lines
408 B
Python
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']
|