Hi all, I have a newbie question regarding the cascade delete of referenced
database entries. Basically, I have these two tables:
tab = DAL('sqlite://tab.sqlite')
tab.define_table('tests',
Field('test_id', 'integer', required=True, default=''),
Field('test_pid', 'integer', ondelete='NO ACTION'),
Field('args'))
tab.define_table('test_counts',
Field('test_id', tab.tests, requires=IS_IN_DB(tab,
tab.tests.test_id, '%(test_id)s'), ondelete='CASCADE'),
Field('message'))
and I want web2py to create SQLite tables tests and test_counts.
Test_counts should reference "test_id" field from the tests table and
whenever the test entry with the corresponding test_id is deleted the
appropriate rows in test_counts should be deleted as well, but it doesnt
work that way and I am unable to find a solution either using my knowledge
or google as well.
Thanks in advance for any answer, Jan