The name of a reference does not have to be the name of the field it is
referencing -- in fact, usually it is not the same name (in web2py, the
referenced field is typically "id"). In web2py, it is common for the
reference field to simply have the same name as the referenced table,
though some people like to tack "_id" onto the end of the field name. So,
in this case, field names "Person" and "Skill" would be typical, or maybe
"Person_id" and "Skill_id".
Anthony
On Tuesday, January 1, 2013 3:46:56 PM UTC-5, Alex Glaros wrote:
>
> what is the syntax for renaming a reference field in order to avoid
> duplicate names in a table?
>
> example:
>
> db.define_table('PersonSkill',
> Field('*id*','reference Person'),
> Field('*id*','reference Skill'),
> Field('YearsOfExperience','integer'))
>
> The "id" field name would be duplicate because it is the same spelling in
> Person Table and Skill Table.
>
> Also, does web2py reference field work in Postgres?
>
> thanks!
>
> Alex Glaros
>
--