AlexW
AlexW

Reputation: 2587

django admin home page - add descriptions to the sites

I was wondering how/if I can add descriptions to the admin home page or more columns?

For example where it says On call and Pdusers underneath (my model is pdUsers). Is it possible to change that display name of the model? Can I also add another column to put a description of the model next to name?

Thanks

admin page

Upvotes: 0

Views: 144

Answers (1)

m.antkowicz
m.antkowicz

Reputation: 13581

You need to add Meta class implementation with verbose_name and verbose_name_plural values set inside of your model class instance

    class YourModel(models.Model):
        field = models.IntegerField(null=False, blank=False, verbose_name="Just the field")

        class Meta:
            verbose_name = "My pretty model"
            verbose_name_plural = "My pretty models"

verbose_name_plural's value is visible in Admin panel overwiev page. verbose_name's when you get into the model

Upvotes: 2

Related Questions