various
authorThierry Parmentelat <thierry.parmentelat@inria.fr>
Wed, 20 Mar 2013 20:47:44 +0000 (21:47 +0100)
committerThierry Parmentelat <thierry.parmentelat@inria.fr>
Wed, 20 Mar 2013 20:47:44 +0000 (21:47 +0100)
manifold/js/manifold.js
manifold/manifoldproxy.py
manifold/manifoldquery.py
unfold/page.py
unfold/templates/page-queries.js

index 6cd209b..763b242 100644 (file)
@@ -1,8 +1,11 @@
 // utilities 
-function debug_dict (msg, o) {
+function debug_dict_keys (msg, o) {
     var keys=[];
     for (var k in o) keys.push(k);
-    console.log ("debug_dict: " + msg + " keys= " + keys);
+    console.log ("debug_dict_keys: " + msg + " keys= " + keys);
+}
+function debug_dict (msg, o) {
+    for (var k in o) console.log ("debug_dict_keys: " + msg + " [" + k + "]=" + o[k]);
 }
 function debug_value (msg, value) {
     console.log ("debug_value: " + msg + " " + value);
index 553dcfe..99057f4 100644 (file)
@@ -37,7 +37,7 @@ with the query passed using POST"""
         # translate incoming POST request into a query object
         if debug: print 'manifoldproxy.proxy: request.POST',request.POST
         manifold_query = ManifoldQuery()
-        manifold_query.fill_from_dict(request.POST)
+        manifold_query.fill_from_POST(request.POST)
         # retrieve session for request
         manifold_api_session_auth = request.session['manifold']['auth']
         # actually forward
index b7f88c4..412de67 100644 (file)
@@ -63,7 +63,7 @@ class ManifoldQuery:
     # this builds a ManifoldQuery object from a dict as received from javascript through its ajax request 
     # e.g. here's what I captured from the server's output
     # incoming POST <QueryDict: {u'query[subject]': [u'slice'], u'query[fields][]': [u'slice_hrn'], u'query[timestamp]': [u'latest'], u'query[action]': [u'get']}>
-    def fill_from_dict (self, d):
+    def fill_from_POST (self, d):
         for key in d.keys():
             for arg in ['action', 'subject', 'filters', 'fields', 'timestamp', 'params']:
                 if arg in key:
index bc8c01b..b00194f 100644 (file)
@@ -61,7 +61,7 @@ class Page:
         # compute variables to expose to the template
         env = {}
         # expose the json definition of all queries
-        env['queries_jsons'] = [ query.to_json() for query in self._queries ]
+        env['queries_json'] = [ query.to_json() for query in self._queries ]
         env['query_uuid_domids'] = [ {'query_uuid' : a, 'domid': '"%s"'%b if b else 'null'} for (a,b) in self._queue ]
         javascript = render_to_string ("page-queries.js",env)
         self.reset_queue()
index a6c470b..d4e29a6 100644 (file)
@@ -1,4 +1,4 @@
-{% for json in queries_jsons %} manifold.insert_query({{ json|safe }});
+{% for json in queries_json %} manifold.insert_query({{ json|safe }});
 {% endfor %}
 $(document).ready(function () {
   var query_uuid_domids = new Array();