On Tue, Jul 12, 2011 at 2:52 PM, Damien Accorsi <[email protected]> wrote:
> But... I'd like to decorrelate SQLA queries from my forms. What type of
> object is to be sent?
>

As I suggested on the previous mail inheriting from validators.OneOf
and overriding the list property should work

class CallableOneOf(validators.OneOf):
    @property
    def list(self):
        return self._list()

    @list.setter
    def list(self, callable):
        self._list = callable

this way you should be able to pass a callable to the validator.
Actually I have not tested the code itself, consider it more pseudocode ;)

-- 
You received this message because you are subscribed to the Google Groups 
"TurboGears" 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/turbogears?hl=en.

Reply via email to