Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Made it possible to have multiple preparers. #63

Merged
merged 7 commits into from Sep 18, 2012
Merged

Made it possible to have multiple preparers. #63

merged 7 commits into from Sep 18, 2012

Conversation

jayd3e
Copy link
Contributor

@jayd3e jayd3e commented Sep 18, 2012

Still need to write tests/docs for this feature. Just curious if there was an api reason for this feature not getting implemented yet. All tests pass. With this feature, you are now able to provide the preparer kwarg with a list of preparers, as opposed to a single one, like so:

class SolutionSchema(MappingSchema):
      post_id = SchemaNode(Int())
      body = SchemaNode(String(),
                        validator=Length(15, 3000),
                        preparer=[strip_whitespace,
                                  remove_multiple_spaces,
                                  remove_multiple_newlines])

@jayd3e
Copy link
Contributor Author

jayd3e commented Sep 18, 2012

Looks like I removed some whitespace too XD.

@mcdonc
Copy link
Member

mcdonc commented Sep 18, 2012

When you say "yet", do you mean it was suggested before? The feature seems fine (although small nit, always a little hinky to test for "is list" or so.. usually better to check for iter, although it's tricky on py3, there's a is_nonstr_iter func in compat).

…elf.preparer) == list, as per mcdonc's request.
@jayd3e
Copy link
Contributor Author

jayd3e commented Sep 18, 2012

I couldn't find an issue where it was being suggested, yah dunno what I really meant by that in hindsight. Check out that latest commit, is that what you meant? Err and I just saw your note about is_nonstr_iter. Should I use that instead?

@jayd3e
Copy link
Contributor Author

jayd3e commented Sep 18, 2012

Yah nvm, need to use that.

@jayd3e
Copy link
Contributor Author

jayd3e commented Sep 18, 2012

@mcdonc This should be ready to go.

@mcdonc mcdonc merged commit 371071b into Pylons:master Sep 18, 2012
@mcdonc
Copy link
Member

mcdonc commented Sep 18, 2012

Thanks Joe! (next time try to go a little lighter on the whitespace changes, though eh? ;-) )

@mcdonc
Copy link
Member

mcdonc commented Sep 18, 2012

Hey Joe when you get a chance could you submit a different pull request and sign colander's CONTRIBUTORS.txt?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants