Created
October 5, 2016 14:21
-
-
Save rectalogic/22716c62355b0ce11558d5f33e57cce2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from formencode import Schema, ForEach | |
from formencode.validators import Email, UnicodeString, RequireIfMissing | |
class TestSchema(Schema): | |
recipients = ForEach(Email(not_empty=True), convert_to_list=True) | |
service = UnicodeString(not_empty=False, if_missing=None) | |
chained_validators = [RequireIfMissing('service', missing='recipients')] | |
print TestSchema.to_python({}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment