[web2py] Re: Id been Shown Instead of Name in dropdown list

2011-11-13 Thread Massimo Di Pierro
You have this db.tblDriver.id_tblVehicle.requires=IS_IN_DB(db,'tblVehicle.id'), This statement is optional. Its presence overrides the default formatting.remove this line its is not needed. On Nov 12, 12:09 am, Naleen Yadav wrote: > This is the final model after following given suggesstion by

Re: [web2py] Re: Id been Shown Instead of Name in dropdown list

2011-11-11 Thread Naleen Yadav
This is the final model after following given suggesstion by you all # Table Vehicle name master db.define_table("tblVehicleName", Field("VehicleName", length=45, notnull=True, default=None,unique=True,label='Vehicle Name'), format='%(VehicleName)s' ) # Table Vehicle db.define_

Re: [web2py] Re: Id been Shown Instead of Name in dropdown list

2011-11-11 Thread Naleen Yadav
Thanks for Your reply but its not working . still I am getting id instead of Vehicle name. Regards, Naleen Yadav www.genpro.co.in On Fri, Nov 11, 2011 at 10:12 PM, Massimo Di Pierro < massimo.dipie...@gmail.com> wrote: > From Burno'e example > > db.tblDriver.id_tblVehicle.requires=IS_IN_DB(db, '

[web2py] Re: Id been Shown Instead of Name in dropdown list

2011-11-11 Thread Massimo Di Pierro
>From Burno'e example db.tblDriver.id_tblVehicle.requires=IS_IN_DB(db, 'tblVehicle.id') is optiona and automatic. If you add it it overrides the format so you want to do db.tblDriver.id_tblVehicle.requires=IS_IN_DB(db, 'tblVehicle.id',format=lambda row: "%s" % row.**VehicleName_id.VehicleName)