I am using the filter in Django queryset, as it takes arguments like:
Model.objects.filter(name="Amit")
here is name and it's value, I am getting from the request of API:
def get(self, request):
column = request.query_params.get('column')
val = request.query_params.get('value')
query = Data.objects.filter(column=val).values()
serializer = DataSerializer(query, many=True).data
return Response(serializer)
but here column [inside filter] is not getting recognized as the request parameter, it is taken as the column name of the table which is not available.
The error I got:
django.core.exceptions.FieldError: Cannot resolve keyword 'column' into field.
Hope this information is suitable for understanding the problem, if something is missing please let me know and kindly help me out with this.