在Django管理中显示一个ManyToManyField作为复选框 [英] Show a ManyToManyField as Checkboxes in Django Admin
本文介绍了在Django管理中显示一个ManyToManyField作为复选框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
解决方案
我认为没有简单的方法来做到这一点。您可以尝试覆盖ModelAdmin类,但这不是一个简单的方式。
但是您可以使用filter_horizontal或filter_vertical添加几乎相似的功能
Is there a simple way to show a ManyToManyField as Checkboxes in Django Admin?? Any suggestions?
解决方案
I think there is no simple way to do this. You can try to override ModelAdmin class but this is not a "simple" way.
But you can use filter_horizontal or filter_vertical to add almost similar functionality
这篇关于在Django管理中显示一个ManyToManyField作为复选框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文