It really depends on how you select and which row indexing you want.
To use db().select(...)
you have to specify table.field pairs in the select (without the db
part)
and to obtain the value of field1 you use row['table.field1'].
If you are selecting fields from only one table the alternative would
be
db(
db.table.id>0).select(*[list of fields without table prefix])
and each value is accessible as row['field'].
To use db().select(...) as in your first post
you would build the comprehension with:
L=[ 'table2.%s'%f for f in db['table1'].fields if f not in blacklist ]
which creates a list L with:
'table2.field1', 'table2.field2', ...
where field1, field2, ... are field names from table1 that are not
black listed,
and that list can be used directly in the select:
rows=db().select(*L) # note the * before the list
Hope this helps,
Denes
On Oct 20, 11:16 am, Richard Vézina <
ml.richard.vez...@gmail.com>
wrote:
> Near of it... Your list comprehension is doing much simpler then I were
> doing what it should do.
>
> But the problem is still there...
>
> First the
>
> [f for f in db['table1'].fields if f not in BlackList]
>
> Return a list (['field1','field2', etc.]) without the rest of the
> information needed : "db.table"
>
> I was having in a :
>
> 'db.table.field1, db.table.field2, etc.'
>
> Second it is a list.
>
> My fundamental problem is that I try tu use the content of a variable as
> code for my app and that should not be a common thing in programmation since
> I am not a experienced programmer.
>
> I don't know if I should do something else to resolve my problem...
>
> Basically I would do exactly the inverse of columns= do in SQLTABLE
>
> Richard
>