Commits

Matthew Schinckel committed bad7f1f

Finished jsonify template tag.

  • Participants
  • Parent commits 634bcc9

Comments (0)

Files changed (1)

File jsonfield/templatetags/jsonify.py

+from django import template
+from django.utils import simplejson as json
+from django.utils.safestring import mark_safe
+from django.core.serializers.json import DjangoJSONEncoder
+
+register = template.Library()
+
+@register.filter
+def jsonify(value):
+    return mark_safe(json.dumps(value, cls=DjangoJSONEncoder))