@Massimo - your response assumes the data is being consumed in python, not 
in a json response which is where it gets ugly - see the code below. 

@Anthony,
per your suggestion I think the data needs some additional  processing 
 before returning a response - in which case why not skip the dal and use 
an exec sql command. 

For completeness  here is how I coded the reference to the computed value 
 in my Javascript - imho this is a truly ugly hack, since the view is now 
tightly coupled to the way the web2py dal  handles computed fields, when it 
should be treated as just another data element. (Not sure I'd want to 
maintain this type of code).

// display the json response
//
  var itags = response.tagsummary; 
        for (var x=0; x< itags.length; x++){        
            dojo.byId("tagsummary").innerHTML += '<li>' + itags[x].tag.name 
+'; '  + itags[x]._extra['COUNT(tagref.tag)' ]+ '</li>';    
        }

BrendanC

Reply via email to