>
> TR ( TD ( *SELECT ( OPTION ( _value='' ), OPTION (
> _value='1', '1' ), *
* for i,row in enumerate(rows): *
> * OPTION ( 'row.product_name', _value='
> row.id' ), *
> * _id='sale_product', _name='product' )*),
>
Yes, that's definitely not valid Python syntax -- you're passing an entire
for loop as an argument to a function. You could instead use a list
comprehension:
SELECT(OPTION(_value=''), OPTION(_value='1', '1'),
*[OPTION('row.product_name', _value='row.id') for row in rows],
_id='sale_product', _name='product' )
Also, note that in Python, it is not common to put spaces before and after
your parentheses.
Anthony
--
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.