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 <[email protected]> wrote:
> On Sep5, 11:51pm, "mr.freeze" <[email protected]> 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 [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
-~----------~----~----~----~------~----~------~--~---