Ok. One way is to use the represent attribute of db.requests.product field.
You can setup this in models after the table definition with:
db.requests.product.represent = lambda id: db.product(id).description
id is a parameter to lambda which takes the value of the current field value
(for product
i want to select record from 2 tables.
I have table requests that have a column product. This column is only the id
of the product
to know the meaning of the id i have to connect the 2 tables to know the
product.description
thank you
2011/7/28 Miguel Lopes
> The DAL is not SQL, it has a dife
The DAL is not SQL, it has a diferent logic.
What are you trying to achieve?
2011/7/28 António Ramos
> this
> db(db.requests.product==*db.products.id*==3).select()
>
> returns all field from *product* table only
>
> this
> db(db.products.id==*db.requests.product*==3).select()
>
> returns all
this
db(db.requests.product==*db.products.id*==3).select()
returns all field from *product* table only
this
db(db.products.id==*db.requests.product*==3).select()
returns all field from *requests* table only
What is the logic?
and if i want all record from both tables?
thank you
António
4 matches
Mail list logo