def with_active_jobs(self):
        now = timezone.now()
        return self.filter(
            jobs__status='approved',
            jobs__expires__gte=now,
        ).distinct()
JobCategory with active jobs
dataset/ETHPy150Open python/pythondotorg/jobs/managers.py/JobCategoryQuerySet.with_active_jobs