Revert a bad change. Apparently past me knew what I was doing,
authorDiane Trout <diane@caltech.edu>
Tue, 5 Apr 2011 05:37:41 +0000 (22:37 -0700)
committerDiane Trout <diane@caltech.edu>
Tue, 5 Apr 2011 05:37:41 +0000 (22:37 -0700)
and I needed to manually construct the dictionary for feeding
a json object, instead of just handing the json.dumps function a
random django object.

unlike the RDFa template which can just operate on the django ORM object.

htsworkflow/frontend/samples/views.py

index c57508fa120efc6645ecb78e58e7b2cefadb943e..c96b71870c946d15678cd030f670a5a0ae854c9e 100644 (file)
@@ -555,7 +555,9 @@ def library_json(request, library_id):
     require_api_key(request)
     # what validation should we do on library_id?
     
-    lib = get_object_or_404(Library, library_id=library_id)
+    lib = library_dict(library_id)
+    if lib is None:
+        raise Http404
 
     lib_json = json.dumps(lib)
     return HttpResponse(lib_json, mimetype='application/json')