[Answered ]-Django: How do you compare a QuerySet with fields on a ForeignKey object's property?

1👍

You can work with an F object [Django-doc] to refer to a field, so:

from django.db.models import F, Q

Songs.objects.annotate(
    songs_count=Count('recording', filter=Q(recording__status='O'))
).filter(songs_count__gt=F('limit'))

Leave a comment