After upgrading to v2.9.3 (from 2.8.2), error is thrown:
Traceback (most recent call last):
File "/vagrant/grand/web2py/gluon/restricted.py", line 217, in restricted
exec ccode in environment
File "/vagrant/grand/web2py/applications/grand/models/db_contract.py", line
13, in <module>
Field('actual_date', 'date', readable=False, writable=False)
File "/vagrant/grand/web2py/gluon/dal.py", line 8223, in define_table
table = self.lazy_define_table(tablename,*fields,**args)
File "/vagrant/grand/web2py/gluon/dal.py", line 8260, in lazy_define_table
polymodel=polymodel)
File "/vagrant/grand/web2py/gluon/dal.py", line 925, in create_table
raise KeyError('Cannot resolve reference %s in %s definition' %
(referenced, table._tablename))
KeyError: 'Cannot resolve reference subject_subject in contract_contract
definition'
With lazy_tables=True everything is ok, but in development environment I don't
want use True value. My table definitions are grouped in separate files, so
situation is next:
models/db_contract.py:
db.define_table('contract_contract'
...
Field('subject_id', 'reference subject_subject')
...
)
models/db_subject.py
db.define_table('subject_subject',
...
)
As I understand the problem occurs because db_contract.py is executed before
db_subject.py, Is it posible to revert back to executement like in v2.8.2 (it
means that such situation won't throw any error without setting lazy_tables to
True)? Or it is new feature?
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.