Django:使用Atomic Operations时的TypeError

时间:2014-05-11 07:05:33

标签: python django google-app-engine django-models

我在谷歌应用引擎中有一个django应用程序。 在特定模型中,我IntegerField默认为0,并希望原子递增它。

我在用户表单提交上做了这样的事情

from django.db.models import F

pobj.right_answers = F('right_answers') + 1
pobj.save()

当我这样做时,程序正在提高以下

TypeError: int() argument must be a string or a number, not 'ExpressionNode'

为什么会发生这种情况以及如何解决?

0 个答案:

没有答案