Works now. Thanks!
On Sep 7, 10:55 am, mdipierro <mdipie...@cs.depaul.edu> wrote:
> for various reasons:
> - sqlhtml is already too heavy, the more we delegate to the validators
> and the wdgets the better
> - because one should be able to do use the IS_IN_SET validator without
> having the dropdown
>
> I added the missing like and uploading...
>
> Massimo
>
> On Sep 7, 10:50 am, "mr.freeze" <nat...@freezable.com> wrote:
>
> > It throws an error for IS_IN_DB. It's just missing 'self.zero = zero'
> > in the __init__ function. It works after that. I'm curious though,
> > why did you moved it from OptionsWidget to the validators?
>
> > On Sep 7, 10:25 am, mdipierro <mdipie...@cs.depaul.edu> wrote:
>
> > > I modified your patch.
>
> > > In trunk try this
>
> > > Field(...,requires=IS_IN_SET(('a','b','c'),zero=T('choose one')))
>
> > > the option "zero" will be added at top but not accepted unless:
>
> > > Field(...,requires=IS_NULL_OR(IS_IN_SET(('a','b','c'),zero=T('choose
> > > one'))))
>
> > > please give it a try.
>
> > > Massimo
>
> > > 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
-~----------~----~----~----~------~----~------~--~---