Hi,

I would like to know if there is a way as simple of "requires = IS_IN_DB" to
show a dropbox of what is already in my table, but without the need of
requiring that field be entered in my other table. I have many fields that
need dropbox but they are not all used at the same time (nulls fields : not
normalised table)...

Hope I am clear!

Here an example :

db.define_table('person',
   SQLField('fname'),
   SQLField('lname'),format='%(fname)s %(lname)s')

db.define_table('dog',
   SQLField('name'),format='%(name)s')

db.define_table('cat',
   SQLField('name'),format='%(name)s')

db.define_table('ownership',
   SQLField('person', db.person),
   SQLField('dog', db.dog),
   SQLField('cat',db.cat))

db.ownership.person.requires = IS_IN_DB(db,'person.id','%(fname)s
%(lname)s')
db.ownership.dog.requires = IS_IN_DB(db, 'dog.id', 'dog.name')
db.ownership.cat.requires = IS_IN_DB(db, 'cat.id', 'cat.name')



I would like to be able to add the relation between person and dog without
have to enter a cat in the case of person that has no cat.

Thanks.

Jonhy

Reply via email to