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 <[email protected]> wrote: > On Mar 2, 4:32 pm, Jonathan Lundell <[email protected]> wrote:> On Mar 2, > 2010, at 10:46 AM, [email protected] wrote: > > > > I have a form with a string field that uses the IS_IN_SET validator. > > > The set of strings that is allowed must be generated dynamically each > > > time the form is generated. So I add the validator in the controller. > > > ( See the snippet below. ) > > > > The problem is that sometimes I get "value not allowed" validation > > > errors from that field. Why? I am restricted to selecting only the > > > items in the list given to IS_IN_SE. It seems like it would be > > > impossible to select a value that is not allowed. > > > One thing that occurs to me is that this code is being executed twice, once > > to display the form and once to accept it. So if it's possible that > > get_last_names() could return different values on successive calls (perhaps > > because a user was deleted), you'd see that failure. > > True but I am assuming that is not the case and that the problem > occurs nevertheless, at least to him. -- You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.

