Hi,

Why am I getting an error here?

model.py

db=SQLDB("sqlite://db.db")

db.define_table('test',
    Field('t', 'reference test2'))

db.define_table('test2',
    Field('t1', 'reference test'))


Error:

Traceback (most recent call last):
  File "c:\web2py\gluon\restricted.py", line 178, in restricted
    exec ccode in environment
  File "c:/web2py/applications/video/models/db.py", line 6, in
<module>
    Field('t', 'reference test2'))
  File "c:\web2py\gluon\sql.py", line 1299, in define_table
    t._create_references()
  File "c:\web2py\gluon\sql.py", line 1571, in _create_references
    raise SyntaxError, 'Table: table "%s" does not exist' % referenced
SyntaxError: Table: table "test2" does not exist

Bummer !

Reply via email to