[web2py] Re: Bug in TR when rendering an array

2011-08-31 Thread Noel Villamor
Jonathan, you surely have another way to killl the cat: {{=TABLE(TR([TD('first')]+[TD(x) for x in arr]+[TD('fourth')]))}} Thanks for that. Anthony, thanks to you as well. Noel On Sep 1, 12:55 pm, Jonathan Lundell wrote: > On Aug 31, 2011, at 5:50 PM, Noel Villamor wrote: > > > > > By the way,

[web2py] Re: Bug in TR when rendering an array

2011-08-31 Thread Noel Villamor
Anthony, you surely have another way to killl the cat: {{=TABLE(TR([TD('first')]+[TD(x) for x in arr]+[TD('fourth')]))}} Thanks for that. Noel On Sep 1, 12:55 pm, Jonathan Lundell wrote: > On Aug 31, 2011, at 5:50 PM, Noel Villamor wrote: > > > > > By the way, the reason why I stumbled on th

[web2py] Re: Bug in TR when rendering an array

2011-08-31 Thread Noel Villamor
Following what you said, I would have expected the html result to be: first second third In any case, the following syntax would have been a work-around for the "SyntaxError: only named arguments may follow *expression" but only if the extra wasn't there. {{=TABLE(TR(TD('first'),[TD(x) for x

Re: [web2py] Re: Bug in TR when rendering an array

2011-08-31 Thread Jonathan Lundell
On Aug 31, 2011, at 5:50 PM, Noel Villamor wrote: > > By the way, the reason why I stumbled on this is because I wanted to > add a fourth TD to my test case. > > {{=TABLE(TR(TD('first'),*[TD(x) for x in arr],TD('fourth')))}} > or more simply > {{=TABLE(TR(TD('first'),*arr,TD('fourth')))}} > > B

[web2py] Re: Bug in TR when rendering an array

2011-08-31 Thread Anthony
By the way, the reason you got the output you did is because TR expects its positional arguments to be TD's, and if they are not, it wraps them in a TD. In your case, your second positional argument was a list, so TR wrapped it in a TD for you (it turned out that your list itself contained two T

[web2py] Re: Bug in TR when rendering an array

2011-08-31 Thread Noel Villamor
By the way, the reason why I stumbled on this is because I wanted to add a fourth TD to my test case. {{=TABLE(TR(TD('first'),*[TD(x) for x in arr],TD('fourth')))}} or more simply {{=TABLE(TR(TD('first'),*arr,TD('fourth')))}} But, this results to SyntaxError: only named arguments may follow *exp

[web2py] Re: Bug in TR when rendering an array

2011-08-31 Thread Noel Villamor
Just when I thought I have helped find a bug, I am faced with the revelation that I need to hone my python some more. He he he. Thanks Anthony. On Sep 1, 12:18 pm, Anthony wrote: > The problem is you are passing a list of TD's to TR instead of individual > TD's. Instead, try this: > > {{=TABLE

[web2py] Re: Bug in TR when rendering an array

2011-08-31 Thread Anthony
The problem is you are passing a list of TD's to TR instead of individual TD's. Instead, try this: {{=TABLE(TR(TD('first'),*[TD(x) for x in arr]))}} Notice the "*" before the list comprehension -- that converts the list to a set of positional arguments. Anthony On Wednesday, August 31, 201