Iceberg, do you want to submit a patch? Massimo, do you have any issues with this change? I verified that it works when multiple=True as well.
On Sep 5, 12:33 pm, "mr.freeze" <nat...@freezable.com> wrote: > Very cool! The only thing I would change is to add it to the top of > the list of options: > > if value not in [k for k,v in options]: > opts.insert(0, OPTION(value,_value=value)) > > On Sep 5, 12:03 pm, Iceberg <iceb...@21cn.com> wrote: > > > On Sep5, 11:51pm, "mr.freeze" <nat...@freezable.com> wrote: > > > > Perhaps a better solution is checking if the value for 'default' > > > argument is *not* in the set and then appending it to the set but not > > > allowing it to pass validation if selected. What do you think? > > > You are a genius! This solution reaches the original goal without any > > known side effect. > > > And the implementation is simple, too. Just add the following 2 lines > > into OptionsWidget() 's widget(), one line before the final return. > > Problem solved! > > > if value not in [k for k,v in options]: > > opts += [OPTION(value,_value=value)] > > > Strongly recommended! Thanks Freeze! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web2py@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 -~----------~----~----~----~------~----~------~--~---