【Python】Django 聚合 Count与Sum用法,注意点

代码示例:

from django.db.models import Sum, Count
            #alarm_sum_group_items = models.FILE_PROTECT_ALARM.objects.filter(**condition).filter(device_hash=tmp_dict['device_hash']).values('device_hash').annotate(alarm_sum=Sum('cmn_merge_count'))
            #tmp_dict['customer_id'] =

你可能感兴趣的:(python)