From ad6ebdd21b0be23a246af3817c886637491ee23f Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Wed, 20 Mar 2013 21:47:44 +0100 Subject: [PATCH] various --- manifold/js/manifold.js | 7 +++++-- manifold/manifoldproxy.py | 2 +- manifold/manifoldquery.py | 2 +- unfold/page.py | 2 +- unfold/templates/page-queries.js | 2 +- 5 files changed, 9 insertions(+), 6 deletions(-) diff --git a/manifold/js/manifold.js b/manifold/js/manifold.js index 6cd209b2..763b242e 100644 --- a/manifold/js/manifold.js +++ b/manifold/js/manifold.js @@ -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); diff --git a/manifold/manifoldproxy.py b/manifold/manifoldproxy.py index 553dcfe9..99057f48 100644 --- a/manifold/manifoldproxy.py +++ b/manifold/manifoldproxy.py @@ -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 diff --git a/manifold/manifoldquery.py b/manifold/manifoldquery.py index b7f88c4a..412de674 100644 --- a/manifold/manifoldquery.py +++ b/manifold/manifoldquery.py @@ -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 - 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: diff --git a/unfold/page.py b/unfold/page.py index bc8c01b2..b00194f8 100644 --- a/unfold/page.py +++ b/unfold/page.py @@ -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() diff --git a/unfold/templates/page-queries.js b/unfold/templates/page-queries.js index a6c470b3..d4e29a6e 100644 --- a/unfold/templates/page-queries.js +++ b/unfold/templates/page-queries.js @@ -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(); -- 2.43.0