title: Referencing a table in web2py before defining it
body: <p>My code is the following im trying to assign a department to employees and also create a manager in a department table</p>
  
  <pre><code>db = DAL(lazy_tables=True)
  db.define_table('employee',
              Field('fullname','string',label='Name'),
              Field('email','string'),
              Field('phone','string'),
              Field('kids', 'string'),
              Field('phone', 'string'),
              #Field('date','datetime'),
              Field('dob', 'datetime', label='Date'),
              Field('department', 'reference department',
                    requires=IS_IN_DB(db, db.department.id, '%(department_name)s')),
              auth.signature,
              format='%(fullname)s'
  
              )
  db = DAL(lazy_tables=True)
  db.define_table('department',
              Field('department_name', 'string', label='Department Name'),
              # Field('department_name', 'string', label='Department Name'),
              Field('manager', 'reference employee', required='true',
                    requires=IS_IN_DB(db, db.employee.id, '%(fullname)s')),
              auth.signature,
              format='%(department_name)s'
              )
  </code></pre>