INSERT INTO subject VALUES(field=value)
-------------------------------------------------------------*/
- this.__repr = function (q) {
+ this.__repr = function () {
res = "ManyfoldQuery ";
- res += " id=" + q.query_uuid;
- res += " a=" + q.action;
- res += " s=" + q.subject;
- res += " ts=" + q.timestamp;
- res += " flts=" + q.filters;
- res += " flds=" + q.fields;
- res += " prms=" + q.params;
+ res += " id=" + this.query_uuid;
+ res += " a=" + this.action;
+ res += " s=" + this.subject;
+ res += " ts=" + this.timestamp;
+ res += " flts=" + this.filters;
+ res += " flds=" + this.fields;
+ res += " prms=" + this.params;
return res;
}
}
this.filters.push(new Array(key, op, value));
}
- this.remove_filter = function (key,op,value){
+
+ this.remove_filter = function (key,op,value) {
// if operator is null then remove all occurences of this key
if(!op){
this.filters = jQuery.grep(this.filters, function(val, i) {
this.filters = jQuery.grep(this.filters, function(val, i) {return (val[0] != key || val[1] != op);});
}
}
+
// FIXME These functions computing diff's between queries are meant to be shared
- this.diff_fields = function (otherQuery)
- {
+ this.diff_fields = function (otherQuery) {
var f1 = this.fields;
var f2 = otherQuery.fields;
var removed = jQuery.grep(f1, function (x) { return jQuery.inArray(x, f2) == -1 });
return {'added':added, 'removed':removed};
- }
+ }
+
// FIXME Modify filter to filters
- this.diff_filter = function (otherQuery)
- {
+ this.diff_filter = function (otherQuery) {
var f1 = this.filters;
var f2 = otherQuery.filters;
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]);
+ for (var k in o) console.log ("debug_dict: " + msg + " [" + k + "]=" + o[k]);
}
function debug_value (msg, value) {
console.log ("debug_value: " + msg + " " + value);