如何限制外键下拉? [英] how to limit the foreignkey dropdown with constraints?
本文介绍了如何限制外键下拉?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如果有人有任何建议,那将是非常感谢!
解决方案
p>您正在寻找 limit_choices_to
。
I have a database which keeps track of interaction between two different teams (represented in the admin interface by two different groups). For some fields, i have a foreignkey to Users database, and i would like to limit the dropdown people to only the specific groups.
If anyone have any suggestions, it would be much appreciated!
解决方案
You're looking for limit_choices_to
.
这篇关于如何限制外键下拉?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文