jpmckinney / validictory

🎓 deprecated general purpose python data validator
Other
240 stars 57 forks source link

adding handling for blank=True when validating enumerated field #83

Closed boblannon closed 9 years ago

boblannon commented 9 years ago

my interpretation of how an enumerated field should be validated when it is also given the property {"blank": True}.

jamesturk commented 9 years ago

thanks for this, I think it makes sense but want to play with it a bit to make sure there are no unintended consequences that might break things.

I'm most likely going ahead w/ merging it but is there a reason not to include '' in the enumeration?

boblannon commented 9 years ago

You can do that, but it will still fail for being blank if blank isn't set to True, so this was to avoid having to do it in two places.

jamesturk commented 9 years ago

Ah didn't realize that was the case, this makes sense then. I'll write up a quick test and merge it in

On Thu, Feb 19, 2015 at 10:48 AM, Bob Lannon notifications@github.com wrote:

You can do that, but it will still fail for being blank if blank isn't set to True, so this was to avoid having to do it in two places.

— Reply to this email directly or view it on GitHub https://github.com/sunlightlabs/validictory/pull/83#issuecomment-75075023 .

James Turk Labs Director | Sunlight Foundation http://www.sunlightfoundation.com/ 202-558-8723 | @JamesTurk https://twitter.com/jamesturk

[image: Sunlight Foundation] http://sunlightfoundation.com/