django.template.loaders.cached.Loader
https://docs.djangoproject.com/en/dev/ref/templates/api/#loader-types
Showing posts with label template. Show all posts
Showing posts with label template. Show all posts
Oct 20, 2011
Jul 4, 2011
Currency template filter
from django import template
import locale
register = template.Library()
@register.filter(name='currency')
def currency(value):
try:
locale.setlocale(locale.LC_ALL,'en_US.UTF-8')
except:
locale.setlocale(locale.LC_ALL,'')
loc = locale.localeconv()
return locale.currency(value, loc['currency_symbol'], grouping=True)
Subscribe to:
Posts (Atom)