*Hi, All:*
*
*
*Having these two tables*

*db.define_table(*
*    'salescompany',*
*    Field('name') )*
*
*
*db.define_table(*
*    'salescompany_user',*
*    Field('user_id', db.auth_user , unique = True ),*
*    Field('salescompany_id', db.salescompany    ) )*

*in these three lines*

   * current_user_id = auth.user.id*
*    *
*    xsalescompany_id=db(db.salescompany_user.user_id == 
current_user_id).select(db.salescompany_user.salescompany_id).first()*
*      *
*    salescompany_name=db(db.salescompany.id == int(xsalescompany_id) 
).select(db.salescompany.name).first()*

I am trying to get the name of the salescompany for the current user.

unfortunately, I get this error

<type 'exceptions.KeyError'> 'id'

pointing to the third line.

Pls, enlighten me.

Thanks,

Ashraf

-- 



Reply via email to