I have search option which user input from front end.
search = {"Date":"2016-02-07","Status":"pass" }
Then I am mapping with those values with column names in DB.
query_to_field_mapping = {"Date": "date","Status": "result"}
query = {query_to_field_mapping[key]: value for key, value in search.items()}
Now I have DateTimeField in DB. When I am using filter I am trying with below one:
result = Customer.objects.filter(**query)
Here am trying to filter as per date field & want to get the filtered record as well. I tried the same with no success .How can I proceed?
Any help ll be awesome!!!
I tried the some other question from SO: How can I filter a date of a DateTimeField in Django?
I couldn't get a way to solve my problem as there we are passing a column name 1 by 1 .But right now I am passing as dictionary.