在新的dev django版本中,如何在管理站点上将一些模型的名称从"类别"更改为"类别"?
然而,现在在基于modeladmin的类中设置verbose_name_复数并没有任何作用.
在新的dev django版本中,如何在管理站点上将一些模型的名称从"类别"更改为"类别"?
然而,现在在基于modeladmin的类中设置verbose_name_复数并没有任何作用.
好的,看起来Meta类的方法仍然有效. 因此,在模型中放置一个元类仍然可以做到这一点:
class Category(models.Model):
class Meta:
verbose_name_plural = "categories"
请注意,我们在这里使用小写,因为Django足够聪明,可以在需要时将其大写.
I find setting this option in model-class weird as opposed to the admin.py file.
Here is the location in the dev docs where it is described:
http://docs.djangoproject.com/en/dev/ref/models/options/#verbose-name-plural