Hi,
Please help me with following.
I have created the api I am passing company_name(string) to it, for select I am comparing reference Id to name.
I get the error
<type 'exceptions.ValueError'> invalid literal for long() with base 10: 'cadence'
at db.company_user.company == company_name
I actually don't know how to compare reference id to name.
@request.restful()
def company_user():
def GET(company_name, role=None):
company_user_ids = [u['auth_user'] for u in db(db.company_user.company == company_name
).select()]
query = db.auth_user.id.belongs(company_user_ids)
auth_users = db(query).select(db.auth_user.ALL)
return json(auth_users)
return locals()
Thanks.