Change model class name in Django admin interface

Django

Django Problem Overview


> Possible Duplicate:
> Verbose name for admin model Class in django

I had a model with a class like:

class Anh_chi_tiet(models.Model):
    du_an       = models.ForeignKey(Du_an)
    title       = models.CharField(max_length=120)
    url         = models.ImageField(upload_to='images')
    url_detail  = models.ImageField(upload_to='images')

When I go to admin interface, my Anh_chi_tiet class has a label: Anh_chi_tiets (added s suffix) But I want to change my class label to "My image"

How can I do that?

Django Solutions


Solution 1 - Django

Via inner Meta class, as documented:

class Anh_chi_tiet(models.Model):
    # ... fields ...

    class Meta:
        verbose_name = 'My image'
        verbose_name_plural = 'My images'

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionSon TranView Question on Stackoverflow
Solution 1 - DjangoCat Plus PlusView Answer on Stackoverflow