gpt4 book ai didi

python - Django Formset - 检查行标记是否已删除

转载 作者:太空宇宙 更新时间:2023-11-04 10:48:18 24 4
gpt4 key购买 nike

如何检查表单集行是否被标记为已删除?

for row in myformset:
//check if row is mark as deleted

提前致谢!

最佳答案

https://docs.djangoproject.com/en/dev/topics/forms/formsets/#can-delete

Similar to can_order this adds a new field to each form named DELETE and is a forms.BooleanField.

它只是一个名为 DELETE 的 Django 表单字段,因此应该可以通过 row.cleaned_data.get('DELETE') 访问它

关于python - Django Formset - 检查行标记是否已删除,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15737245/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com