-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
Python model to dict fix #8652
Python model to dict fix #8652
Conversation
Merge upstream fixes
update with upstream master
@@ -1217,7 +1217,7 @@ def model_to_dict(model_instance, serialize=True): | |||
elif isinstance(value[0], ModelSimple): | |||
result[attr] = [x.value for x in value] | |||
else: | |||
result[attr] = [model_to_dict(x, serialize=serialize) for x in value] | |||
result[attr] = [model_to_dict(x, serialize=serialize) if hasattr(x, '_data_store') else x for x in value] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@code-lucidal58 How about adding a test that will fail if this is broken? If that had existed then this bug would not have been introduced. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure. Will add it
@code-lucidal58 I would like to help finish this PR by adding a schema in the python sample spec and then adding a test of it in the sample python client. Can you add me as a colaborator on your repo? Github is not letting me push to your branch in your repo. |
@spacether It would be better if you clone my branch to your repo. This PR is very old now. Plus I won't be able to add you as a collaborator to CiscoM31 repo (the source repo in this PR) as it is Cisco's GitHub account. |
Closing this PR as the issue is resolved here #9153 |
Fix #8651
PR checklist
This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
These must match the expectations made by your contribution.
You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example
./bin/generate-samples.sh bin/configs/java*
.For Windows users, please run the script in Git BASH.
master
,5.1.x
,6.0.x
@taxpon (2017/07) @frol (2017/07) @mbohlool (2017/07) @cbornet (2017/09) @kenjones-cisco (2017/11) @tomplus (2018/10) @Jyhess (2019/01) @arun-nalla (2019/11) @spacether (2019/11)