Skip to content

Resolved issue with rendering of nested serializers form when value is None #3263

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

Merged
merged 1 commit into from
Aug 13, 2015

Conversation

jgadelange
Copy link
Contributor

Fix for #3260

def __init__(self, field, value, errors, prefix=''):
if value is None:
value = {}
super(NestedBoundField, self).__init__(field, value, errors, prefix)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we do transform value in 'as_form_field' instead? Does that work too?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it does. As long as as_form_field returns the self.__class__(...)

@tomchristie
Copy link
Member

Okay, believe we've more work to do here, but this seems more correct, so lets pull this in as a start.
Evidently need to look at building out some test cases for these kinds of input.

tomchristie added a commit that referenced this pull request Aug 13, 2015
Resolved issue with rendering of nested serializers form when value is None
@tomchristie tomchristie merged commit 0e6c467 into encode:master Aug 13, 2015
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.

2 participants