如何更改 Django 中 InlineModelAdmin 对象中显示的默认 3 个实例

发布于 2024-10-24 06:42:09 字数 209 浏览 4 评论 0原文

当您在 Django 中定义 InlineModelAdmin 类时,默认情况下,它会在模型​​的管理页面中显示 3 个模型,这些模型具有我在类中定义的模型的外键。

如何更改它?

我只是不想使用 max_num 字段,因为使用它时,我将无法在页面中添加其他实例。

谢谢

When you define a InlineModelAdmin class in Django, by default it shows 3 models in the admin page of the model that has a Foreign Key to the model I defined in the class.

How can I change that?

I just don't want to use max_num field, because when using it, I won't be able to add another instances in the page.

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文