-1
I am using the Django Rest Framework and would like to make a mass exclusion using the "contract" field which is an interger.
View py.
class AlugueisViewSet(viewsets.ModelViewSet):
filter_backends = (filters.SearchFilter,DjangoFilterBackend)
queryset = Alugueis.objects.all()
serializer_class = AlugueisSerializer
filterset_fields = {
'contrato':['exact']
}
Send
Request URL: http://127.0.0.1:8000/rentals/? id=&contract=174
Request Method: DELETE
Status Code: 405 Method Not Allowed
Remote Address: 127.0.0.1:8000
Referrer Policy: Strict-origin-when-cross-origin
Since you are using viewset, we still need to implement the Destroy function.
– Danizavtz
could put an example?
– Alessandro Barros