Take this example
db.define_table('table1', Field('title));
db.define_table('table2',Field('title'),Field('table1_id',db.table1))
db.define_table('table3',Field('title'),Field('table2_id',db.table2,'another_table2_id',db.table2));

Now I want to write a validator that makes sure Both table2 and
another_table2 come from the same table1

Now this:
db.table3.another_table2_id.requires =
IS_IN_DB(db(db.table2.table1_id.id==db.table3.table2_id.table1.id),db.table2.id)

Won't do the job for me. It just throws an error in dal.py, that goes:

TypeError: int() argument must be a string or a number, not 'Table'

I'm pretty sure I've covered all I know. Can anyone have a brighter
idea?

Reply via email to