I have a validator:
class Blog(validators.FancyValidator):
def validate_python(self, value, state):
value = int(value)
if not value:
raise validators.Invalid(self.message('blogNotExists',
state),
value, state)
blogs = _get_user_blogs()
if not blogs:
raise validators.Invalid(self.message('noBlogsYet', state),
value,
state)
elif value not in blogs:
raise validators.Invalid(self.message('notYourBlog',
state),
value, state)
return value
Here is the relevant form widget:
blog = widgets.SingleSelectField(label="Blog", options=get_blogs,
validator=sbvalidators.Blog(), default=_get_blog_id)
The validator was working yesterday. I am not sure what it was, but all
of the suddon it sipmly _stopped_ working. It gets called when I start
the server, but never during validation. It seems to not only be this
validator, either. I have created ones that do nothing but raise an
exception and they still do not work, what-so-ever. I have tried
putting them in _to_python, _from_python, validate_python, etc (pretty
much every hook in the formencode documentation). Does someone have
experience with this problem? Can anyone suggest I try anything?
Thanks,
-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
-~----------~----~----~----~------~----~------~--~---