'How to list overdue objects?

I want to create a query that shows which user has how many overdue (out of date) missions.

query_overdue = Case.objects.select_related('last_changed_by').values('due_date').order_by('assigned_to').annotate(
            name=F('assigned'),
            due=F('due_date'),
        )

This query shows every object but I want to filter it with not none value and overdue. How can I do it?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source