I want to retrieve data behalf of mobile number or cnic number how I can give conditionally parameters
Here is the url path('api/filterapplication/<cnic> || <mobile>', ApplicationLIST1.as_view()), Here is the my view.py class ApplicationLIST1(generics.ListAPIView): def get(self, request, cnic, mobile): snippets = Application.objects.filter(cnic=cnic) | Application.objects.filter(mobile=mobile) serializer = ApplicationSerializer(snippets, many=True) return Response(serializer.data) It's now working -- You received this message because you are subscribed to the Google Groups "Django REST framework" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-rest-framework+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-rest-framework/7165654d-bbdc-4e79-91c2-ff1d92438f1cn%40googlegroups.com.