Your error seems to be coming from the fact you do not have defined a person model. Since web2py is a functional designed you must define person table before you can reference it.
I use the following self-referential table and have never had a problem. db.define_table('participant', #... lots of other fields Field("referred_by", "reference participant"), #... lots of other fields. ) -- Thadeus 2010/11/11 Mirek Zvolský <zvol...@seznam.cz> > >> Here's a link to the section in the book: > >> > http://www.web2py.com/book/default/chapter/06#Self-Reference-and-Aliases > > Yes, I know this, and from that reason I always use 'reference..' > style syntax. > > However this is about very special foreign keys, which targets to same > table (to the primary key in same table). > > And if there is some cycle in joins in the model (and of course it > always is, except of very, very simple models), this will not help. > And there is realy no solution for this in web2py ?? >