Let's say your table name is from_to.

Then you have something like

arbitrary_last_name = 'Smith' # make this assignment at run time
query = (
  (db.auth_user.last_name==arbitrary_last_name) &
  (db.auth_user.id==db.from_to.from_user) &
  (db.from_to.to_user==db.auth_user.id)
)
db(query).select(db.auth_user.first_name, db.auth_user....)



On Thursday, July 19, 2012 6:57:03 PM UTC-4, Ashraf Mansour wrote:
>
> Hi,
>
> The first table has two fields:
>
> *  from_user , db.auth_user*
> *  to_user , db.auth_user*
>
> both are referencing db.auth_user.
>
> How to get the list of records in the first table with the corresponding 
> first_name of the two fields?
>
> I am confused, because I don't know how to differentiate the two field --- 
> db.auth_user.name for the two fields.
>
> Regards,
>
> Ashraf
>

-- 



Reply via email to