当 ForeignKey 数据过多,手动在后台添加时不方便找到自己的想要数据,遂想要一个可以搜索检索数据功能。
With this you can use the autocomplete_fields
on a foreignkey
field on your source admin class and as before set the search_fields
on the target admin class.
被搜索的字段需要在其对应对的模型的 admin 中加入到 search_field