def base_query(self):
        request_ver = amo.LOG.REQUEST_VERSION.id
        review_ids = [str(r) for r in amo.LOG_REVIEW_QUEUE if r != request_ver]

        return {
            'select': SortedDict([
                ('yearmonth',
                 "DATE_FORMAT(`log_activity`.`created`, '%%Y-%%m')"),
                ('approval_created', '`log_activity`.`created`'),
                ('user_id', '`log_activity`.`user_id`'),
                ('total', 'COUNT(*)')
            ]),
            'from': [
                'log_activity',
            ],
            'where': ['log_activity.action in (%s)' % ','.join(review_ids)],
            'group_by': 'yearmonth, user_id'
        }
dataset/ETHPy150Open mozilla/addons-server/src/olympia/editors/models.py/PerformanceGraph.base_query/original