> Hmmm, my guess is that "get_blogs" is being called outside the > request when the SingleSelectField is trying to guess a validator. > Can you please confirm this guess by providing a validator to the > widget? > > from turbogears.validators import Int > class X(widgets.WidgetsList): > blog = widgets.SingleSelectField(label="Blog", > options=get_blogs, validator=Int()) > > Should be enough. > > If this works I'm not sure if it's a widgets' bug but a corner case > involving callables which need a request availble *for* the > SingleSelectField (which is the only one which tries to guess a > validator). > > Maybe remove this "guessing" behaviour? It clearly contradict the "in > the case of ambiguity avoid the temptation to guess" principle IMO. > > Alberto
I've tried it with and without a validator. The validators that I've tried were Int() and NotEmpty, both of them with the same result. That's not to say it still isn't calling it outside of the request to guess the validator, that's entirley possible. I'll more closely examine the stack trace to see where exactly I'm getting the error (that's assuming the stack trace offers anything of value). If I track anything down and fix it, does turbogears have tests in place for this that I can run? -Sam --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

