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