Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在我的 admin.py 上注册时尝试了详细名称,以便它显示为 Data 而不是 Datas ,但这不起作用。
admin.site.register(数据,verbose_name="数据")
有任何想法吗?
你应该verbose_name_plural在这种情况下设置。文档在这里。
verbose_name_plural
此外,您应该在模型的模型选项上设置它(此处Meta的文档)。例子:
Meta
class MyModel(models.Model): # my fields class Meta: verbose_name_plural = "PluralForMyModel"