Maybe reading IS_IN_DB doc could helps... Richard
On Tue, Feb 21, 2012 at 5:22 PM, Richard Vézina <ml.richard.vez...@gmail.com > wrote: > Ok by new style I mean this syntax : > > db.dog.owner.requires = IS_IN_DB(db,*db.person.id*,'%(name)s') > > > Instead of : > > db.dog.owner.requires = IS_IN_DB(db,* 'person.id'*, '%(name)s') > > > In red... > > So, I assume this is possible I am maybe wrong : > > db.dog.owner.requires = IS_IN_DB(db,db.person.id, db.person(db.person.id > ).name) > > Then if that is possible, why not : > > db.dog.owner.requires = IS_IN_DB(db,db.person.id,'%s' % db.person( > db.person.id).name db.othertable(db.person(db.person.id > ).fk_to_other_table_id).field_other_table) > > The way your table are related affect how you have to write the request... > > db.table(id).field is nothing else then db(db.table.id == > id).select(db.table.field).first().field > > Richard > > On Tue, Feb 21, 2012 at 5:00 PM, Ashraf Mansour <ad...@aqar-riyadh.com>wrote: > >> Unfortunately, did not work (both). >> >> Do you know of any running example? >> in other words, where is it explained, old style and new style? >> >> On Feb 22, 12:33 am, Ashraf Mansour <ad...@aqar-riyadh.com> wrote: >> > I will try both and i will let you know. >> > >> > On Feb 22, 12:27 am, Richard Vézina <ml.richard.vez...@gmail.com> >> > wrote: >> > >> > >> > >> > >> > >> > >> > >> > > On Tue, Feb 21, 2012 at 4:27 PM, Richard Vézina < >> ml.richard.vez...@gmail.com >> > >> > > > wrote: >> > > > Old >> > >> > > > IS_IN_DB(helper_set,'table.id','%(field1)s >> (%(field2)s)',multiple=True) # >> > > > One table >> > >> > > > Maybe this work but not sure : >> > >> > > > IS_IN_DB(helper_set,'table.id',db.table2(db.table1.id).fieldTable2,multiple >> =True) >> > > > # 2 tables >> > >> > > > Richard >> > >> > > > On Tue, Feb 21, 2012 at 4:21 PM, Ashraf Mansour < >> ad...@aqar-riyadh.com>wrote: >> > >> > > >> Thank you for the immediate reply. >> > >> > > >> please rewrite the example using the old requires syntax. >> > >> > > >> On Feb 21, 10:39 pm, Richard Vézina <ml.richard.vez...@gmail.com> >> > > >> wrote: >> > > >> > For represent I usually do : >> > >> > > >> > lambda id: db.fktable1(id).represent_field # 1 table >> > > >> > lambda id: >> db.fktable2(db.fktable1(id).id).represent_field_table2 # 2 >> > > >> table >> > >> > > >> > You can maybe proceding the same way, but I am not sure... I am >> still >> > > >> using >> > > >> > old requires syntax... >> > >> > > >> > Please report your experiment and how you solve it. >> > >> > > >> > Richard >> > >> > > >> > On Tue, Feb 21, 2012 at 1:57 PM, Ashraf Mansour < >> ad...@aqar-riyadh.com >> > > >> >wrote: >> > >> > > >> > > Hi All, >> > >> > > >> > > can the query in IS_IN_DB have more than one table? >> > >> > > >> > > And how the fields of these tables be referenced in the >> format, to be >> > > >> > > shown in the dropbox ? >> > >> > > >> > > Thanks in advance. >> > >> > > >> > > Ashraf >> > >