Django - Template display model verbose_names & objects
For accessing it in your template, you've probably noticed by now that Django doesn't let you use underscore prefixes to access attributes from templates. Thus, the easiest way to access the verbose name for any given object without having to create a model method on each model would be to just create a template tag:
@register.simple_tag
def get_verbose_name(object):
return object._meta.verbose_name
Unrelated, but you have a bug in your template, in that you are trying to access the _meta attribute on a queryset instead of an object. So your title line should instead look something like:
{% with objs|first as obj %}
<div class="title">{% get_verbose_name obj %}</div>
{% endwith %}