this is what IS_IN_DB does internally. I do not think it does help in
this case.

The fact is you need a more sohisticated autocomplete because when you
type something you need not just the autocompleted text but also the
id corresponding to it. You need to create this logic.

On Feb 3, 6:10 am, selecta <gr...@delarue-berlin.de> wrote:
> IS_IN_SET(dict([(i.id,i.name) for i in db(db.paint.id>0).select()]))
>
> did not test it but it should work
>
> On Feb 3, 10:31 am, Jason Brower <encomp...@gmail.com> wrote:
>
> > I have autocomplete working... it properly displays the information I
> > want.  I also have it integrated with my model that is being rendered.
> > But I used this before:
> > db.orders.paints.requires = IS_IN_DB(db, 'paint.id', '%(name)s')
> > Which worked very nicely because it used the ID in that feild but
> > displayed the name.
> > How do I get the form to get the id rather than the name in that feild.
> > With the way it is now it takes a text feild and errors telling me I
> > don't have an integer. :/
> > I see two ways of fixing it, but dont' know how to do it...
> > 1. Change the submit of the form to look for the id based on paint.name.
> > 2. Make the form submit the actual ID but still show the name.
> > The second sounds faster as I don't have to query that database for that
> > unique name.  I just know it. :D
> > Best Regards,
> > Jason Brower
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.

Reply via email to