[web2py] Re: Modify behavior foreign key

2011-11-17 Thread Massimo Di Pierro
 IS_IN_DB(db.t_city, ...) ? should be IS_IN_DB(db, ) On Nov 17, 1:06 pm, Renato Ramiro wrote: > I asked the same question in the > web2py-users-brazil > . > > And this was the suggestion: > > ### > db.t_ho

Re: [web2py] Re: Modify behavior foreign key

2011-11-17 Thread Renato Ramiro
I asked the same question in the web2py-users-brazil . And this was the suggestion: ### db.t_hospital.f_group.requires = IS_IN_DB(db.t_city, 't_city.id', db.t_city.f_group, zero=T('[Choose an item from the list]'

[web2py] Re: Modify behavior foreign key

2011-11-17 Thread Massimo Di Pierro
are you sure you want Field('f_group', type='reference t_city', label=T('Group')), and not Field('f_group', type='reference t_group', label=T('Group')), On Nov 17, 5:52 am, Renato Ramiro wrote: > In my application, I have two tables: City and Hospital. > > In the table City,

[web2py] Re: Modify behavior foreign key

2011-11-17 Thread DenesL
It sound like you need to create three tables instead, one for cities, one for groups and one for city-group combos. On Nov 17, 6:52 am, Renato Ramiro wrote: > In my application, I have two tables: City and Hospital. > > In the table City, there are two fields: name and group. > And the table Ho