Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The use of model field "verbose name"

If I have a web app that use only one language and it is not English, is that correct to use model field verbose_name attribute for the field description (that will be printed in form)? I dont use the translation modules.

like image 690
user3599803 Avatar asked Mar 30 '16 16:03

user3599803


1 Answers

Verbose Field Names are optional. They are used if you want to make your model attribute more readable, there is no need to define verbose name if your field attribute is easily understandable. If not defined, django automatically creates it using field's attribute name. Ex : student_name = models.CharField(max_length=30) In this example, it is understood that we are going to store Student's name, so no need to define verbose explicitly.

Ex : name = models.CharField(max_length=30)

In this example, one may be confused what to store - name of student or Teacher. So, we can define a verbose name.

name = models.CharField("student name",max_length=30)

like image 140
Akshay Katiha Avatar answered Sep 19 '22 02:09

Akshay Katiha