[英]django: create submodel for a model
You need to set up the Players model as a many-to-one with the parent model and then use InlineModelAdmin to view this in the admin. 您需要将播放器模型与父模型设置为多对一,然后使用InlineModelAdmin在管理员中查看。
You can refer to - https://docs.djangoproject.com/en/2.2/ref/contrib/admin/#inlinemodeladmin-objects 您可以参考-https://docs.djangoproject.com/en/2.2/ref/contrib/admin/#inlinemodeladmin-objects
The solution is given in the documentation: https://docs.djangoproject.com/en/2.2/ref/contrib/admin/#django.contrib.admin.TabularInline 该解决方案在文档中给出: https : //docs.djangoproject.com/en/2.2/ref/contrib/admin/#django.contrib.admin.TabularInline
as Higor Rossato mentioned in the comment 正如Higor Rossato在评论中提到的
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.