+class IndexValidator(Schema):
+ "Trivial schema validator for SubHandler's indexes"
+ index = Int
+ def to_python(self, value, state=None):
+ # we want to return the index directly, the only purpose of this
+ # validation being a schema is for field error reporting
+ return super(Schema, self).to_python(dict(index=value), state)['index']
+