Django滤波器后的十进制和

2024-09-27 21:30:31 发布

您现在位置:Python中文网/ 问答频道 /正文

我有个Django问题:

helpers = project.helpers.annotate(sum=Sum(u'amount'))

在数据库中有一个helper,其和十进制值为100。 当我开始下一个代码时,我有成功的价值:

^{pr2}$

但是如果我想找一个帮助者的查询集,我会得到[]:

helpers.filter(sum__gt=Decimal('100')

Count似乎在这里工作,但Sum不起作用。为什么?在


Tags: django代码helperproject数据库filteramounthelpers

热门问题