如何在django中转换更新查询

时间:2014-04-30 03:51:21

标签: mysql django

我想在 django 中使用以下查询。

update notes from Testcase where (testid==givenid);

我尝试了这个但不幸的是它没有工作。我怎么能在django中写这个?

Testcase.objects.filter(id=givenid).upadte(notes)

1 个答案:

答案 0 :(得分:0)

tc = Testcase.objects.get(id=givenid)
tc.some_field = "some_value"
tc.save()
相关问题