I need the third table's field to be a reference to either of the two first tables.
Is there a way to define this in terms of field type and validators ?
I was thinking along the lines of:
db.define_table('my_table', Field('fruit_id', type=???, requires=IS_IN_DB(db, db.melon, _or=IS_IN_DB(db, db.watermelon)))
or maybe:
db.define_table('my_table', Field('fruit_id', type=???, requires=any([IS_IN_DB(db, db.melon), IS_IN_DB(db, db.watermelon)]))
But of course it doesn't work...
How can I work around this issue ?