[Answered ]-Django ORM get record with latest date

1👍

You can retrieve the Users for which there is no RdpUserPasswordHash for the last 90 days with:

from datetime import timedelta

from django.utils.timezone import now

User.objects.exclude(password_hash__when__gte=now() - timedelta(days=90))

Leave a comment