Maybe Ivan was just thinking of the Reference fields?
http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Field-types


If so try:

 db.define_table('jogador',
Field('nome', 'reference equipe'),
Field('posicao','string'),
Field('altura','double'),
Field('peso','double'),
Field('equipe')
        )

On Wed, 22 Jul 2020 at 16:53, Dave S <snidely....@gmail.com> wrote:

>
>
> On Tuesday, July 21, 2020 at 5:59:20 PM UTC-7, Ivan Luis wrote:
>>
>> db.define_table('jogador',
>> Field('nome', 'string'),
>> Field('posicao','string'),
>> Field('altura','double'),
>> Field('peso','double'),
>> Field('equipe')
>>         )
>>
>> db.define_table('equipe',
>> Field('nome', 'string')
>>        )
>>
>> I'm trying do reference the field " Equipe " at Jogador with "Name" at
>> Equipe but i don't know how to do this, i'm beginner in web2py and beginner
>> on Developer Life too
>> Can someone help me understand how this thing works ?
>>
>
> I don't understand what you are asking.
>
> If you have a field "nome" in the two tables that match up, you can do a
> join between the tables, and from the join results select the fields you
> want to display or manipulate.  Rows in the tables that have the value
> "Todo" in the field "nome" would be combined to make a larger row.
>
> But your sample code seems to have nothing in the "Equipe" table except
> "nome"., so I'm not sure what you want that table for.
>
> BTW, you seem to have applied a color option to your sample code that
> makes it almost impossible to read ... white on white, it looks like.  I've
> changed the color in my reply.  If this is a result of pasting from your
> editing tools (IDE, perhaps), be warned ... and maybe check the color
> yourself.
>
> /dps
>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/web2py/1bd9b206-eaad-41de-a0f8-0467e27d9c45o%40googlegroups.com
> <https://groups.google.com/d/msgid/web2py/1bd9b206-eaad-41de-a0f8-0467e27d9c45o%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/CACWMBMMCu2oW2yvss%3DoJkAmhvY%3DV9M_8J1tQw%2BAGErf6OzyHOw%40mail.gmail.com.

Reply via email to