def _case_query_opened_closed(self, opened_or_closed, values, filters, lower, upper):
        return CaseData.objects \
            .extra(select={'case_owner': '{}_by'.format(opened_or_closed)}) \
            .values(*values) \
            .filter(filters) \
            .filter(
                domain=self.domain) \
            .filter(**self._date_filters('{}_on'.format(opened_or_closed), lower, upper)) \
            .filter(**{
                '{}_by__in'.format(opened_or_closed): self.users_needing_data
            }).annotate(count=Count('case_id'))
Enable this object's notifications.
dataset/ETHPy150Open dimagi/commcare-hq/corehq/apps/callcenter/indicator_sets.py/CallCenterIndicators._case_query_opened_closed--crossover with--dataset/ETHPy150Open typesupply/defcon/Lib/defcon/objects/base.py/BaseObject.enableNotifications