[Django] Correct the plural form of the model name on the management screen

Django model name

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.

Try to correct the display

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

At the end

A memorandum this time as well. I hope it helps someone.

Recommended Posts

[Django] Correct the plural form of the model name on the management screen
The story of failing to update "calendar.day_abbr" on the admin screen of django
Customize the model page on Django's admin screen
Make the model a string on a Django HTML template
The story of a Django model field disappearing from a class
Until the start of the django tutorial with pycharm on Windows
DJango Memo: From the beginning (more edits to the management screen)
Get the host name of the host PC with Docker on Linux
Freely customize the model. Change the variable name and field name of the model of the Django / Django Rest Framework app ~ How to reflect the deployment on heroku Memo
Development of WEB application using Django [Add data from management screen]
DJango memo: From the beginning (using the management screen) my addictive point
[Django] Display registration data associated with users on the registration / edit form (Form)
Is the probability of precipitation correct?
Python-Simulation of the Epidemic Model (Kermack-McKendrick Model)
Try Ajax on the Django page
Get the value from the [Django] Form
The meaning of ".object" in Django
DJango memo: From the beginning (editing the management screen) There is a mystery
The story of trying to push SSH_AUTH_SOCK obsolete on screen with LD_PRELOAD
How to make only one data register on the Django admin screen