From a5f5557493446bede78adb0584c88208234f874e Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Sat, 12 May 2012 09:32:30 -0500 Subject: Use python json module directly in place of simplejson As of Python 2.6, this is a builtin module that has all the same functions and capabilities of the Django simplejson module. Additionally simplejson is deprecated in the upcoming Django 1.5 release. Signed-off-by: Dan McGee --- visualize/views.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'visualize') diff --git a/visualize/views.py b/visualize/views.py index afc5429..95f8c31 100644 --- a/visualize/views.py +++ b/visualize/views.py @@ -1,9 +1,9 @@ from datetime import datetime +import json from django.contrib.auth.models import User from django.db.models import Count, Sum, Q from django.http import HttpResponse -from django.utils import simplejson from django.views.decorators.cache import cache_page from django.views.generic.simple import direct_to_template @@ -61,13 +61,13 @@ def arch_repo_data(): @cache_page(1800) def by_arch(request): data = arch_repo_data() - to_json = simplejson.dumps(data['by_arch'], ensure_ascii=False) + to_json = json.dumps(data['by_arch'], ensure_ascii=False) return HttpResponse(to_json, mimetype='application/json') @cache_page(1800) def by_repo(request): data = arch_repo_data() - to_json = simplejson.dumps(data['by_repo'], ensure_ascii=False) + to_json = json.dumps(data['by_repo'], ensure_ascii=False) return HttpResponse(to_json, mimetype='application/json') @@ -109,7 +109,7 @@ def pgp_keys(request): data = { 'nodes': node_list, 'edges': edge_list } - to_json = simplejson.dumps(data, ensure_ascii=False) + to_json = json.dumps(data, ensure_ascii=False) return HttpResponse(to_json, mimetype='application/json') # vim: set ts=4 sw=4 et: -- cgit v1.2.3-24-g4f1b