Skip to content

Instantly share code, notes, and snippets.

@andres-torres-marroquin
Last active December 19, 2015 19:08
Show Gist options
  • Save andres-torres-marroquin/6003515 to your computer and use it in GitHub Desktop.
Save andres-torres-marroquin/6003515 to your computer and use it in GitHub Desktop.
import datetime
from django import template
register = template.Library()
@register.simple_tag
def get_verbose_name(model, field):
"""
How to use it:
{% get_verbose_name model "field" %}
"""
return model._meta.get_field_by_name(field)[0].verbose_name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment