How may I overrride the ModelAdmin so that it displays components of two models?

天大地大妈咪最大 提交于 2019-12-13 05:11:51

问题


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?


回答1:


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

https://docs.djangoproject.com/en/dev/ref/contrib/admin/#django.contrib.admin.InlineModelAdmin



来源:https://stackoverflow.com/questions/17203589/how-may-i-overrride-the-modeladmin-so-that-it-displays-components-of-two-models

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!