猿问

如果我从 Django 查询集中删除行然后再次过滤怎么办?

考虑以下代码:


questions = Question.objects.only('id', 'pqa_id', 'retain')

del_questions = questions.filter(retain=False)

# Some computations on del_questions

del_questions.delete()

add_questions = questions.filter(pqa_id=None)

将add_questions不包含问题retain=False?即questions当我们delete()在其子集上运行时是否重新评估对象del_questions?


浮云间
浏览 177回答 2
2回答
随时随地看视频慕课网APP

相关分类

Python
我要回答