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

fix: save pass through values #2

Merged
merged 1 commit into from
Jul 28, 2023
Merged

Conversation

playma
Copy link

@playma playma commented Jul 28, 2023

解決這個問題

beda-software#179

@@ -29,27 +29,27 @@ def _extract_relations(self, validated_data):

if isinstance(field, serializers.ListSerializer) and \
isinstance(field.child, serializers.ModelSerializer):
if field.source not in validated_data:
if field_name not in validated_data:
Copy link
Author

Choose a reason for hiding this comment

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

通常 field_name == field.source,但如果不同時,應該 pop field_name 而非 field.source
如下,應該 pop product_data 而非 product

product_data = ProductSerializer(soure='product')

@li716003 li716003 merged commit 70e0268 into master Jul 28, 2023
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