Django generally defines (?) Model names in the singular form. Therefore, the plural "s" is automatically added and displayed on the management site.
However, the category model ** Category ** is changed to ** Categories **, There is no function to leave ** News ** of the news model as ** News **.
These end up being Categorys
and Newss
.
I think it's a display problem, so I think it's okay to go through it. I'm a little worried, so I fixed it.
It is OK if you specify the character you want to display in the Meta option of the model.
class Meta:
verbose_name_plural = 'Categories'
It seems that lowercase letters are fine.
class Meta:
verbose_name_plural = 'categories'
Categories
models.py
class Category(models.Model):
name = models.CharField(max_length=50)
class Meta:
verbose_name_plural = 'Categories'
def __str__(self):
return self.name
A memorandum this time as well. I hope it helps someone.
Recommended Posts