Cannot resolve reference

19 views
Skip to first unread message

yogeshwar khalkar

unread,
Jun 21, 2018, 8:34:22 AM6/21/18
to web2py-users
Hi,

I am getting 

<type 'exceptions.KeyError'> 'Cannot resolve reference company_process in board_meeting definition'

error when using circular reference..

Table structure

db.define_table('board_meeting',
                Field('agenda', 'json'),
                Field('process',db.process),
                Field('event','reference company_process'),
                Field('serial', length=100),
                Field('address','string'),
                Field('description','text'),
                Field('resolution','json'),
                format = '%(serial)s')

db.define_table("company_process",
                Field('process',db.process),
                Field('company',db.company),
                Field('board_meeting',db.board_meeting),
                Field('egm',db.board_meeting),
                Field('steps','integer'),
                Field('filling_document','json'),
                auth.signature,
                format='%(process)s')

I am using web2py 2.16.1

Please help me to solve this.

Thanks.

黄祥

unread,
Jun 21, 2018, 9:14:27 AM6/21/18
to web2py-users
the table should exist first than you can reference it, seems it's a chicken egg problem:
1. table board_meeting have a field that reference to table  company_process (event)
2. table company_process have any fields taht reference to table board_meeting (board_meeting, egm)

best regards,
stifan
Reply all
Reply to author
Forward
0 new messages