Ticket #17419: json.py

File json.py, 222 bytes (added by Lau Bech Lauritzen, 13 years ago)

JSON template tag

Line 
1from django import template
2from django.utils import simplejson
3from django.utils.safestring import mark_safe
4
5register = template.Library()
6
7@register.filter
8def json(value):
9 return mark_safe(simplejson.dumps(value))
Back to Top