On Tuesday, November 8, 2011 1:01:08 PM UTC-5, BrendanC wrote:
>
> @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.
>

Yes, that would be another alternative.
 

> 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).
>

I wouldn't do it client side -- I'd straighten out the data server side (as 
per my suggestion or via executesql). Longer term, maybe we can do 
something with the Rows.as_list() method that produces more usable output 
when the Rows object is the result of a join and/or includes the output of 
expressions (i.e., '_extra').

Anthony

Reply via email to