verbose_name, verbose_name_plural in Django

  • verbose_name is a human-readable name for the field. If you are giving any verbose name then Django will automatically create it using the field’s attribute name, converting underscores to spaces. 
  • The attribute in general changes the field name in admin interface.

    Example:

            field_name = models.Field(verbose_name = "give_your_readable_name_here")


  • verbose_name_plural: The plural name for the object.
       Examples:
                class Meta:
                    verbose_name = "Bank"
                    verbose_name_plural = "Banks"

        Note: If you are not giving verbose_name_plural then Django will use verbose_name + "s".

Comments

Popular posts from this blog

Internationalization (Language Setting) in Django

reverse_lazy() Method in Django

CharFilter in Django