Schema with required and optional fields?
"Hamish Lawson" <hbl-T7IeVJDLM9PtNP1Hz/[email protected]>
| Newsgroups | gmane.comp.python.formencode |
|---|---|
| Message-ID | <[email protected]> |
I want my schema to require that certain fields be present in the input, with other specified fields optional and all other fields disallowed. Is this possible? By default a schema seems to expect *all* declared fields to be present in the input, but setting ignore_key_missing appears to have the result that *no* fields are treated as required (and a NotEmpty validator for a field won't make it required, as it doesn't appear to get called if the field is missing from the input). Hamish Lawson ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV