No he wants also to make a cross table requires or represent... I am working on something for him... I almost finish, I would like criticism when I post my solution...
Richard On Thu, Mar 10, 2011 at 11:14 AM, Massimo Di Pierro < massimo.dipie...@gmail.com> wrote: > You need to change the order > > db.define_table('person', > Field('name',readable=False), > Field('company',db.company,label='Firma',readable=False), > Field('role',label='Rolle',readable=False), > ) > db.define_table('company', > Field('name', readable=False), > ) > db.define_table('document', > Field('name'), > Field('file','upload'), > Field('filename','string',writable=False,label='Dateiname'), > Field('person',db.person), > ) > > db.document.person.requires=IS_EMPTY_OR(IS_IN_DB(db,'person.id', '% > (name)s %(company)s')) > > > > > > > On Mar 10, 5:20 am, Norbert Klamann <norbert.klam...@googlemail.com> > wrote: > > Hello all, > > I want to shoe in the select list a field from another table and don't > know > > how to do it. > > > > I want to show a select list for persons with their name and the name of > the > > company to which they belong > > > > Consider the following model > > db.define_table('document', > > Field('name'), > > Field('file','upload'), > > Field('filename','string',writable=False,label='Dateiname'), > > Field('person',db.person), > > ) > > > > db.document.person.requires=IS_EMPTY_OR(IS_IN_DB(db,'person.id', > '%(name)s > > %(company)s')) ###### here i can only show the number ! > > > > db.define_table('person', > > Field('name',readable=False), > > Field('company',db.company,label='Firma',readable=False), > > Field('role',label='Rolle',readable=False), > > ) > > db.define_table('company', > > Field('name', readable=False), > > ) > > > > Thanks a lot > > > > Norbert >