3👍
Now yes, you could abuse meta to get the verbose_name but there isn’t any correlation to the data from this
{% for field in book._meta.fields %}
{{ field.verbose_name }}
{% endfor %}
I’m not sure how correct this is seeing as Pep8 warnings appear quite often around meta tags (I can’t see about this from a template side)
I would encourage you to look into using values
As a small example this will give you a dict that you can iterate over (this example gives the id and name)
Book.objects.filter(id=book_id).values('id', 'name')[0]
{% for key, val in book_fields %}
{{ key }} {{ val }}
{% endfor %}
The nicer way about this that you only get the fields you actually care about (id isn’t much help to everyone sometimes)
If you leave out the fields from values then you do get all of them, but I’m not sure if its the verbose name that is used
Book.objects.filter(id=book_id).values()[0]
Source:stackexchange.com