且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Django admin ManyToMany 内联“没有外键"错误

更新时间:2023-11-30 16:13:46

管理文档 有一个部分专门用于内联多对多关系.您应该使用 Quote.tags.through 作为 TagInline 的模型,而不是 Tag 本身.

Admin documentation has a section dedicated to inlining with many-to-many relationships. You should use Quote.tags.through as a model for TagInline, instead of Tag itself.