testing interface, more work on backend

This commit is contained in:
j 2009-10-05 00:00:08 +02:00
commit 88c5c3d9ac
20 changed files with 1883 additions and 311 deletions

0
utils/__init__.py Normal file
View file

15
utils/shortcuts.py Normal file
View file

@ -0,0 +1,15 @@
# -*- coding: utf-8 -*-
# vi:si:et:sw=4:sts=4:ts=4
from django.http import HttpResponse
from django.utils import simplejson
from django.conf import settings
def render_to_json_response(dictionary, content_type="text/json"):
indent=None
if settings.DEBUG:
content_type = "text/javascript"
indent = 2
return HttpResponse(simplejson.dumps(dictionary, indent=indent), content_type=content_type)