Commits

Anonymous committed 56db786

Stop using simplejson

Comments (0)

Files changed (1)

 
 from django.http import HttpResponse
-from django.utils import simplejson
 from django.db.models import Q
 from local.models import Location
 
+import json
+
 def search(request):
-    qset = Location.objects.distinct().order_by('postal_code').values(
+    qset = Location.objects.order_by('postal_code').values(
         'id',
         'postal_code',
         'place_name'
-    )
+    ).distinct()
     obj_id = request.GET.get('id', None)
     if obj_id:
         qset = qset.filter(pk=obj_id)
             except (KeyError, ValueError):
                 offset = 0
             qset = qset[offset:offset+limit]
-    return HttpResponse(simplejson.dumps(tuple(qset)))
+    return HttpResponse(json.dumps(tuple(qset)))