- this.to_hash = function() {
- return {'action': this.action, 'method': this.method, 'timestamp': this.timestamp,
- 'filters': this.filters, 'params': this.params, 'fields': this.fields};
+
+ // Callaback received 3 parameters: query, data, parent_query
+ this.iter_subqueries = function(callback, data)
+ {
+ rec = function(query, callback, data, parent_query) {
+ callback(query, data, parent_query);
+ jQuery.each(query.subqueries, function(object, subquery) {
+ rec(subquery, callback, data, query);
+ });
+ };
+
+ if (this.analyzed_query !== undefined)
+ query = this.analyzed_query;
+ else
+ query = this;
+
+ rec(query, callback, data, null);
+ }
+
+ this.select = function(field)
+ {
+ this.fields.push(field);