1👍
✅
Well, you can use django F() expression,
from django.db.models import F
import datetime
now = datetime.datetime.now()
Photo.objects.filter(postTime__lte=now,
postTime__gte=now - datetime.timedelta(minutes=60),
photo_poster__likes__gte=F(photo_poster__favorites) * 0.10,
photo_poster__likes__lte=F(photo_poster__favorites) * 1)
Source:stackexchange.com