This is not fixed in trunk.Please check that it works as you'd expect.
I think so.

IS_NULL_OR(IS_IN_SET(...,multiple=True))
IS_NULL_OR(IS_IN_DB(...,multiple=True))


allow no seletcion without showing an empty option.

Massimo


On May 27, 3:52 pm, Fran <[email protected]> wrote:
> When creating a UI to optionally set permissions on certain objects I
> want to do:
> db[table].access.requires = IS_NULL_OR(IS_IN_DB(db, 'auth_group.id',
> 'auth_group.role', multiple=True))
>
> However this breaks the Multi-select widget.
>
> Now obviously if one of the tags is 'NULL' then it wouldn't make sense
> to store anything but NULL (or else treat the NULL as an error &
> ignore it)
> However the overall aim seems like a potentially common one.
>
> I can seemingly fix it by a simple patch:
> --- gluon\validators.py.849     Wed May 27 21:48:05 2009
> +++ gluon\validators.py Wed May 27 21:48:10 2009
> @@ -1492,7 +1492,7 @@
>  class IS_NULL_OR(object):
>
>      def __init__(self, other, null=None):
> -        (self.other, self.null, self.multiple) = (other, null, False)
> +        (self.other, self.null, self.multiple) = (other, null, True)
>
>      def set_self_id(self, id):
>          if hasattr(self.other, 'set_self_id'):
>
> What is the rationale for the current way of doing things?
>
> F
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to