Created
January 17, 2013 15:38
-
-
Save starsinmypockets/4556828 to your computer and use it in GitHub Desktop.
Underscore to human
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django import template | |
from django.template.defaultfilters import stringfilter | |
register = template.Library() | |
@register.filter | |
@stringfilter | |
def catname(cat): | |
return cat.replace('_', ' ').capitalize() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment