在 Django 管理索引中修改模型所属的应用程序

发布于 2024-12-21 14:31:36 字数 139 浏览 4 评论 0原文

我正在制作一个 Satchmo 网站,我想添加当前不存在的模型。这些新模型都出现在定义它们的应用程序下。这对程序员来说很好,但我希望客户可能不明白为什么菜单在“本地站点”下列出“商店地图”而不是在“商店”下。有什么方法可以修改模型出现在管理索引中的哪个应用程序下?

I am making a Satchmo site and I want to add models that don't currently exist. These new models all appear under the app that they are defined in. This is fine for programmers, but I want the client might not understand why the the menu lists "Store Map" under "Local Site" and not under "Shop". Is there any way to modify which app a model appears under in the admin index?

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

七月上 2024-12-28 14:31:36

您可以更改 app_label 属性< /a> 在模型的元中:

class Meta:
    app_label = 'my_app'

You can change the app_label attribute in the model's meta:

class Meta:
    app_label = 'my_app'
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文