from .models import Employee from django.db.models import F print Employee.objects.filter( salary__gt=F('boss__salary') )