testing interface, more work on backend
This commit is contained in:
parent
b1d4411dc2
commit
88c5c3d9ac
20 changed files with 1883 additions and 311 deletions
0
utils/__init__.py
Normal file
0
utils/__init__.py
Normal file
15
utils/shortcuts.py
Normal file
15
utils/shortcuts.py
Normal 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)
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue