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

Fix "many" serialization with custom accessor, skip_missing #137

Merged
merged 3 commits into from Feb 5, 2015

Conversation

Projects
None yet
2 participants
@3rdcycle

3rdcycle commented Feb 2, 2015

Make sure the 'accessor' parameter is passed on when
the serialize method in Field calls itself recursively.

Lukas Heiniger
Fix "many" serialization with custom accessor
Make sure the 'accessor' parameter is passed on when
the serialize method in Field calls itself recursively.
@sloria

This comment has been minimized.

Member

sloria commented Feb 3, 2015

@3rdcycle Nice catch and patch. Could you please a test to this test class:

class TestAccessor:
? Once the test is added, this is good to merge. If you don't have time to do this, let me know and I can go ahead and do it, probably some time this weekend.

@3rdcycle

This comment has been minimized.

3rdcycle commented Feb 3, 2015

I added the test and allowed myself to make a small change to the other accessor tests. The reason is that I noticed the asserts wouldn't trigger even if the custom accessor was missing. I guess that's because the default accessor in utils.py is smart enough to handle dicts correctly anyway.

@3rdcycle 3rdcycle changed the title from Fix "many" serialization with custom accessor to Fix "many" serialization with custom accessor, skip_many Feb 3, 2015

@3rdcycle 3rdcycle changed the title from Fix "many" serialization with custom accessor, skip_many to Fix "many" serialization with custom accessor, skip_missing Feb 3, 2015

@3rdcycle

This comment has been minimized.

3rdcycle commented Feb 3, 2015

Same issue with 'skip_missing'. I hope it's ok I bundled these together.

@sloria

This comment has been minimized.

Member

sloria commented Feb 5, 2015

@3rdcycle Thanks for fixing the tests and bugs!

@sloria sloria merged commit e691d88 into marshmallow-code:dev Feb 5, 2015

1 check passed

continuous-integration/travis-ci The Travis CI build passed
Details
@sloria

This comment has been minimized.

Member

sloria commented Feb 5, 2015

Backported this fix to 1.2-line

@3rdcycle 3rdcycle deleted the 3rdcycle:fix-custom-accessor branch Feb 5, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment