Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9183609
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T18:50:50+00:00 2026-06-17T18:50:50+00:00

Suppose I have a model: from django.db import models class Test(models.Model): name=models.CharField(max_length=255, verbose_name=u’custom name’)

  • 0

Suppose I have a model:

from django.db import models

class Test(models.Model):
    name=models.CharField(max_length=255, verbose_name=u'custom name')

How do I get my model’s field’s verbose name in templates? The following doesn’t work:

{{ test_instance.name.verbose_name }}

I would very much appreciate the solution, something on lines as we do when using forms, using label attribute in template:

{{ form_field.label }}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T18:50:52+00:00Added an answer on June 17, 2026 at 6:50 pm

    You can use following python code for this

    Test._meta.get_field("name").verbose_name.title()
    

    If you want to use this in template then it will be best to register template tag for this. Create a templatetags folder inside your app containing two files (__init__.py and verbose_names.py).Put following code in verbose_names.py:

    from django import template
    register = template.Library()
    
    @register.simple_tag
    def get_verbose_field_name(instance, field_name):
        """
        Returns verbose_name for a field.
        """
        return instance._meta.get_field(field_name).verbose_name.title()
    

    Now you can use this template tag in your template after loading the library like this:

    {% load verbose_names %}
    {% get_verbose_field_name test_instance "name" %}
    

    You can read about Custom template tags in official django documentation.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Suppose I have the following Event model: from django.db import models import datetime class
Suppose i have : class Library(models.Model): name = models.CharField(max_length = 100) class Books(models.Model): library
Suppose I have this model: class PhotoAlbum(models.Model): title = models.CharField(max_length=128) author = models.CharField(max_length=128) class
Suppose I have a model: class SomeModel(models.Model): id = models.AutoField(primary_key=True) a = models.CharField(max_length=10) b
Suppose I have my models set up already. class books(models.Model): title = models.CharField... ISBN
suppose we have a model in django defined as follows: class Literal: name =
I have a following model: class Car(models.Model): make = models.CharField(max_length=40) mileage_limit = models.IntegerField() mileage
Suppose I have this model (not real code): class Message(models.Model): content = models.CharField(...) mentions
Suppose I have the following models: class User(models.Model): pass class A(models.Model): user = models.ForeignKey(User)
class ExternalUser(models.Model): user = models.ForeignKey(User) external_account_id = models.CharField(max_length=200, null=True, blank=True) class ExternalFriends(models.Model): external_user =

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.