>>> db.define_table('me',Field('mom','reference me'),Field('name'))
>>> me=db.me.insert(name='Kim')
>>> me.mom=me
>>> print me.mom.mom.mom.mom.mom.name
Kim
On May 20, 1:14 pm, Yanni wrote:
> Yes that worked. Kinda weird :)
>
> pet.category.category_name worked.
>
> Thank you very much.
>
> Ya
Yes that worked. Kinda weird :)
pet.category.category_name worked.
Thank you very much.
Yanni.
On May 20, 11:06 am, "mr.freeze" wrote:
> It will do it automatically. You should be able to do:
> pet.category.name
>
> On May 20, 12:58 pm, Yanni wrote:
>
> > I'm slightly confused as to how to re
It will do it automatically. You should be able to do:
pet.category.name
On May 20, 12:58 pm, Yanni wrote:
> I'm slightly confused as to how to reference a field when I have the
> foreign key.
>
> table pets:
> pets.id
> name
> category (foreign key category.id)
> description
>
> table category:
3 matches
Mail list logo