Re: [web2py] Display text in SELECT list

2012-05-09 Thread Richard Vézina
Great Jim, off course like in the represent, pretty good idea... I happy you solve your issue. :) Richard On Wed, May 9, 2012 at 11:09 AM, Jim Steil wrote: > Whoo Hoo! Victory > > Here is the way I got it working: > > In my controller I have the following: > > techSet = db((db.auth_

Re: [web2py] Display text in SELECT list

2012-05-09 Thread Jim Steil
Whoo Hoo! Victory Here is the way I got it working: In my controller I have the following: techSet = db((db.auth_user.id==db.helpdeskTech.userId) & \ (db.helpdeskTech.helpdeskId==ticket.helpdeskId)) db.ticket.assignedTo.requires = IS_NULL_OR(IS_IN_DB(techSe

Re: [web2py] Display text in SELECT list

2012-05-08 Thread Richard Vézina
Also, if you just don't want to use auth_group and auth_membership, you can just add a flag to auth_user if you define your own custom auth_user and then refer to this flag to create your set for IS_IN_DB... Richard On Tue, May 8, 2012 at 4:38 PM, Richard Vézina wrote: > Since virtual field are

Re: [web2py] Display text in SELECT list

2012-05-08 Thread Richard Vézina
Since virtual field are calculated each query I don't think you can refer to them in IS_IN_DB as a table field... Could be a solution if it works. Richard On Tue, May 8, 2012 at 2:10 PM, Jim Steil wrote: > Anyone know if I can use a virtual field in my IS_IN_DB validator? > > -Jim > > > O

Re: [web2py] Display text in SELECT list

2012-05-08 Thread Jim Steil
Anyone know if I can use a virtual field in my IS_IN_DB validator? -Jim On 5/8/2012 12:48 PM, Jim Steil wrote: Richard First off, thanks for all the help, I certainly appreciate it. I'm trying to work with the second suggestion below, but am having trouble as you suspected with getting t

Re: [web2py] Display text in SELECT list

2012-05-08 Thread Jim Steil
Richard First off, thanks for all the help, I certainly appreciate it. I'm trying to work with the second suggestion below, but am having trouble as you suspected with getting the row.id. I'm shying away from the auth_group idea because I prefer to enforce within the db that the users on tha

Re: [web2py] Display text in SELECT list

2012-05-08 Thread Richard Vézina
Ok, I think I understand... You create a kind of materialized view with helpdeskTech??? If you only need a "subset" of auth_user, you can create a auth_group for this. I mean, you create a auth_group "tech" and you assign user to this group then you will be able to make a set of those users like

Re: [web2py] Display text in SELECT list

2012-05-07 Thread Richard Vézina
Sorry for the lazy example, I have to go, I can try to write the proper code if you didn't solve it tomorrow, just ask. Richard On Mon, May 7, 2012 at 5:36 PM, Richard Vézina wrote: > Ok, now I understand... > > You should allways use id instead of name or other field. Anyway I think > you can f

Re: [web2py] Display text in SELECT list

2012-05-07 Thread Richard Vézina
Ok, now I understand... You should allways use id instead of name or other field. Anyway I think you can figure it out from this example : dog name person_id person name stat_about_dog_and_person stat1 stat2 dog_name person_name If I want to get dog_name or person_name in stat_about_dog_and_pe

Re: [web2py] Display text in SELECT list

2012-05-07 Thread Jim Steil
Sorry, not sure I follow. In my example, helpdeskTech is a subset of auth_user. My 'ticket' has a helpdeskTechId (in the assignedTo field), not an id from the auth_user table. I want my select tag to display the auth_user name, but return the helpdeskTechId from the helpdeskTech table. May

Re: [web2py] Display text in SELECT list

2012-05-07 Thread Richard Vézina
auth_user_rows = db().select(db.auth_user.id) make a set : auth_user_set = ((db.auth_user.id == rows.first().id)|(db.auth_user.id == rows.last().id)) IS_IN_DB(auth_user_set,...) Richard On Mon, May 7, 2012 at 4:37 PM, Jim Steil wrote: > Hi > > I am having trouble getting my list to display

[web2py] Display text in SELECT list

2012-05-07 Thread Jim Steil
Hi I am having trouble getting my list to display the way I want it to. Given the following definition: --- helpdeskTech = db.define_table('helpdeskTech', Field('helpdeskTechId', 'id', readable=False), Field('helpdeskId', db.helpdesk, required=True, label='Helpdesk')