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'))
Source:stackexchange.com