[web2py] Re: Problem with IS_IN_SET validator where valid list is dynamic

2010-03-08 Thread hschill...@nasa.gov
    ... Notice, though, that if that fixes the validation, you've still got the problem that the user has selected a last name that's no longer in the database. If you can confirm that this is indeed the bug, you might want to leave the code as-is, since the validation failure is correct

[web2py] Re: Problem with IS_IN_SET validator where valid list is dynamic

2010-03-03 Thread hschill...@nasa.gov
Thanks for all the help again. It should have been obvious to me before but I am sure the problem is that values coming back from get_last_names() are different when the form is generated compared to when it is validated. So I really need to just get the list of last names once and it use it both

[web2py] Re: Problem with IS_IN_SET validator where valid list is dynamic

2010-03-03 Thread DenesL
An ajax autocomplete field would be a better option IMO. There is an experimental AutocompleteWidget in web2py but I believe it still has some issues plus it might not allow enough customization of the query depending on your particular needs in this case. You can create your own widget though.

Re: [web2py] Re: Problem with IS_IN_SET validator where valid list is dynamic

2010-03-03 Thread Jonathan Lundell
On Mar 3, 2010, at 11:29 AM, hschill...@nasa.gov wrote: Thanks for all the help again. It should have been obvious to me before but I am sure the problem is that values coming back from get_last_names() are different when the form is generated compared to when it is validated. So I really

[web2py] Re: Problem with IS_IN_SET validator where valid list is dynamic

2010-03-02 Thread DenesL
Your setup seems to work for me. value not allowed would happen if you don't select a last name from the drop box. Are the values in the drop box OK? What is in last_names? Which web2py version? Denes. On Mar 2, 1:46 pm, hschill...@nasa.gov hschill...@grc.nasa.gov wrote: I have a form with a

[web2py] Re: Problem with IS_IN_SET validator where valid list is dynamic

2010-03-02 Thread hschill...@nasa.gov
On Mar 2, 3:49 pm, DenesL denes1...@yahoo.ca wrote: Your setup seems to work for me. Thanks for trying it. value not allowed would happen if you don't select a last name from the drop box. I definitely do. Are the values in the drop box OK? Yes, they look OK. What is in last_names?

[web2py] Re: Problem with IS_IN_SET validator where valid list is dynamic

2010-03-02 Thread mdipierro
I do not see any error in the code I propose you print the output of last_names = get_last_names( ) to make sure the second time the function is called (when validation is done), the output is the same as the first time (when the dropbox is generated). On Mar 2, 12:46 pm, hschill...@nasa.gov

[web2py] Re: Problem with IS_IN_SET validator where valid list is dynamic

2010-03-02 Thread DenesL
I am testing with the same version (1.75.4) but I can not reproduce the problem. Are you using sqllite? Have you done any migrations or changes that would do one? If yes, try recreating the table. Or it might be something that is not shown in the trimmed down example. On Mar 2, 3:58 pm,

[web2py] Re: Problem with IS_IN_SET validator where valid list is dynamic

2010-03-02 Thread mdipierro
It could also be a problem if get_last_names( ) is caching in ram and there is more than one process running. On Mar 2, 3:52 pm, DenesL denes1...@yahoo.ca wrote: On Mar 2, 4:32 pm, Jonathan Lundell jlund...@pobox.com wrote: On Mar 2, 2010, at 10:46 AM, hschill...@nasa.gov wrote: I have a

[web2py] Re: Problem with IS_IN_SET validator where valid list is dynamic

2010-03-02 Thread hschill...@nasa.gov
Thanks for all the thoughts on this. I will do some more debugging on this tomorrow. I am new to web2py. Is there a way to have the validator code give me a better indication of what value it got and what it expected? ( Aside from adding code to web2py itself, of course! ) -- You received this

[web2py] Re: Problem with IS_IN_SET validator where valid list is dynamic

2010-03-02 Thread mdipierro
not really. you can log/print request.vars.last_name and see what is there. The issue to me is what is in last_names. On Mar 2, 4:02 pm, hschill...@nasa.gov hschill...@grc.nasa.gov wrote: Thanks for all the thoughts on this. I will do some more debugging on this tomorrow. I am new to web2py.