Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
私は単純な集計を持っています:
tot=PurchaseOrderLine.objects.aggregate(total=Sum('price')) return HttpResponse(tot)
これは「合計」を返します。
私が行った場合:
return HttpResponse(str(tot))
表示されます"{'total': Decimal('321.60')}"
"{'total': Decimal('321.60')}"
これからNUMERIC変数を取得するにはどうすればよいですか?
tot=PurchaseOrderLine.objects.aggregate(total=Sum('price'))['total'] return HttpResponse(tot)