Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试使用 django 设置我的第一个 CRUD 页面,到目前为止,我已经分别进入了 D 部分 - 删除。根据在互联网上找到的信息,我尝试了这个:SomeModel.objects.filter(id=id).delete(),但是抛出了一个错误:id() takes exactly one argument (0 given)所以你能告诉我我做错了什么以便让它工作吗?
SomeModel.objects.filter(id=id).delete()
id() takes exactly one argument (0 given)
谢谢你。
SomeModel.objects.filter(id=id)[0].delete()