本文介绍了如何覆盖ModelAdmin以显示两个模型的组件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想要覆盖 ModelAdmin 。但是我想将两个模型的功能包含在一个中。不过我不认为这两个模型合并成一个。有没有其他方式可以覆盖它,并将我的模型的功能包含在一个 ModelAdmin

I want to override the ModelAdmin. But I want to include the functionalities of two models into one. However I'm not considering merging the two models into one. Is there any other way in which I can override it and include the functionalities of both of my models into one ModelAdmin?

推荐答案

这取决于你的模型之间的关系。请查看 InlineModelAdmin

It depends on a relation between your models. Take a look to InlineModelAdmin:

这篇关于如何覆盖ModelAdmin以显示两个模型的组件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-19 21:13