摘要: 正常查询SQL cpu_mem = models.Instances.objects.values( 'owner__department_2').annotate( cpu=Sum('cpu_core'), mem=Sum('memory'), count=Count('instance_id') 阅读全文
posted @ 2020-07-16 10:36 daniell 阅读(94) 评论(0) 推荐(0) 编辑
摘要: 使用connection执行SQL @method_decorator(login_required, name='dispatch') class UseageByDept(TemplateView): def dictFetchAll(self, cursor): desc = cursor.d 阅读全文
posted @ 2020-07-16 10:28 daniell 阅读(112) 评论(0) 推荐(0) 编辑