I have due_date column in DB and trying to filter rows by the value of that column. So the values in the column looks like "2020-01-20" and I am trying to filter it till year and month. NOT till Day In the function below:
def retrieve(request):
date = "2020-01"
tasks = Task_Histories.objects.all().filter(due_date=date)
serializer = InvocesSerializer(invoces, many=True)
return Response(serializer.data)
How can I arrange DB column value before matching it in the filter()?