Re: [FE-discuss] OneOf with deferred call on function?

Top Page
Author: Ian Bicking
Date:  
To: Iain Duncan
CC: formencode-discuss
Subject: Re: [FE-discuss] OneOf with deferred call on function?
Iain Duncan wrote:
> Hi folks, I'm wanting to do the following
>
> validator = OneOf( [ <list generated at call time> ] )
>
> I was hoping this would work
>
> validator = OneOf( get_valid_options )
>
> but it doesn't. Is there something I'm missing to do the above?


Well... doesn't work. You could, I suppose, do:

class OneOfMine(OneOf):
     get_valid_options = None
     @property
     def list(self):
         return self.get_valid_options()


-- 
Ian Bicking : ianb@??? : http://blog.ianbicking.org

------------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB
_______________________________________________
FormEncode-discuss mailing list
FormEncode-discuss@???
https://lists.sourceforge.net/lists/listinfo/formencode-discuss