On Tuesday, January 10, 2012 8:56:34 AM UTC-5, Marcello wrote:
>
> Hello,
>
> Maybe this is a stupid question.
> But I could not find the answer anywhere....
>
> I have, for example, 2 tables:
>
> db.define_table('account',
> Field('name','string'),
> migrate=False)
>
> db.define_table('user',
> Field('account_id',account),
> Field('name','string'),
> migrate=False)
>
> I get an user:
> u = db.user[1]
>
> If I want to get the account name of that user:
> u.account_id.name
>
>
> But I want to have it with:
> u.account.name
>
> Is it possible ??
>
Well, I guess you could just change the name of the "account_id" field to
"account" (which is actually common practice in web2py).
Anthony