403๐
โ
Well well, it seems like the Meta class approach still works.
So placing a meta class inside your model will still do the trick:
class Category(models.Model):
class Meta:
verbose_name_plural = "categories"
Note that we use the lower case here, as django is smart enough to capitalize it when we need it.
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
๐คAndriy Drozdyuk
46๐
for that you need to add meta classes for models
class Category(models.Model):
--- model field here ---
class Meta:
verbose_name = "Category"
verbose_name_plural = "Categories"
Bonus for your models admin in apps.py
class CategoryConfig(AppConfig):
name = "Category"
verbose_name = "Categories"
- [Django]-Is this the right way to do dependency injection in Django?
- [Django]-Has Django served an excess of 100k daily visits?
- [Django]-Django โ Website Home Page
Source:stackexchange.com