[Answered ]-Django Rest – Using a SerializerMethodField and getting an error: 'QuerySet' object has no attribute 'birth_date'

1👍

Try this,

oldest_employee = Employee.objects.filter( birth_date=age_report_dict.get("oldest_birth_date") ) here add .first() in the end like you did for youngest_employee. 

oldest_employee getting a list instead of an object here.

Leave a comment