jpmckinney / validictory

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

default arguments #27

Closed johnnoone closed 12 years ago

johnnoone commented 12 years ago

hello,

my fork now resolves default arguments.

another update is that validate method returns the updated data with default values.

see the tests for a complete example.

jamesturk commented 12 years ago

thanks for this, i'm about to go vacation so apologies in advance if it takes longer than usual to look over this

On Tue, May 15, 2012 at 9:29 AM, johnnoone < reply@reply.github.com

wrote:

hello,

my fork now resolves default arguments.

another update is that validate method returns the updated data with default values.

see the tests for a complete example.

You can merge this Pull Request by running:

git pull https://github.com/johnnoone/validictory master

Or you can view, comment on it, or merge it online at:

https://github.com/sunlightlabs/validictory/pull/27

-- Commit Summary --

  • implements default values

-- File Changes --

A validictory/tests/test_defaults.py (45) M validictory/tests/test_other.py (1) M validictory/validator.py (25)

-- Patch Links --

https://github.com/sunlightlabs/validictory/pull/27.patch https://github.com/sunlightlabs/validictory/pull/27.diff


Reply to this email directly or view it on GitHub: https://github.com/sunlightlabs/validictory/pull/27

jamesturk commented 12 years ago

after talking it over with some other users, introducing a way for the validator to modify the contents of the document isn't something we want to do

dmr commented 11 years ago

In general I agree that the content should not be modified, at least not without explicit api.

What do you think about another method besides validate which could be called "get_validated_data"?

jamesturk commented 11 years ago

Interesting, I think I'd be open to this approach, are you interested in taking a pass at it?