// 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);
# 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
# 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:
# 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()
-{% 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();