[Answer]-How to ignore null dates when sorting using django-filter

1👍

You can use something like this:

if self.request.GET.get('o') == '-most_recent_project':
    queryset = queryset.filter(most_recent_project__isnull=False)
...

You can read about it here: https://docs.djangoproject.com/en/dev/topics/db/queries/#lookups-that-span-relationships

Leave a comment