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.
Asked
Active
Viewed 1.2k times
10

user3599803
- 6,435
- 17
- 69
- 130
-
2Translation is not a module. Is a built-in. Verbose Name is not about translation, but about giving a readable name to your model. If the model name is clear enough in your class name, you don't need Verbose Name declared. – Luis Masuelli Mar 30 '16 at 17:02
-
Most of the times, you don't need verbose_name (which is not a model field but a model meta option) if you don't need translations. – Luis Masuelli Mar 30 '16 at 17:03
-
I just want a way to assign a string to print the model field name. Something like unicode (toString). Is it fine to use this attribute? – user3599803 Mar 30 '16 at 17:21
-
3For model field names YES. `verbose_name=` is the right tool for a human readable name, while `help_text=` is the right tool for a descriptive text of what does the field do. – Luis Masuelli Mar 30 '16 at 17:44
-
Even if you are only using english language, such field arguments are pretty useful – Luis Masuelli Mar 30 '16 at 17:44
1 Answers
12
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)

Stedy
- 7,359
- 14
- 57
- 77

Akshay Katiha
- 404
- 5
- 9
-
2Can you add more clarity to your answer? The answer states that `They are used if you want to make your model attribute more readable...`. The question then is to *whom*? Is it *django forms*, *django admin*, somewhere else? That's the answer (at least) i was looking for. What is stated in this answer is more or less what already provided in the [docs](https://docs.djangoproject.com/en/4.0/topics/db/models/#verbose-field-names-1) – Gr3at Mar 14 '22 at 08:07