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

Resolved issue with validation running multiple times for nested serializers; minor usage improvement #174

Open
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

OscarVegener
Copy link

Resolved issue with validation running multiple times for nested serializers by using fast_to_internal_value instead of calling is_valid. All serializers that are nested must use NestedOnlySerializerMixin in order to be able to save the changes to object. If nested serializer has other nested serializers, it should use both NestedOnlySerializerMixin and BaseNestedModelSerializer.

Minor usage improvement for update_or_create_reverse_relations: if field is OneToOneField then pk will be retrieved automatically and does not need to be specified when making a request.

The changes potentially can lead to incompatibility with newer DRF versions as serializer's save method is overwritten completely.
Let me know of any improvements that should be made.

Copy link

@auvipy auvipy left a comment

Choose a reason for hiding this comment

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

is it possible to verify this changes with tests?

@OscarVegener
Copy link
Author

@auvipy Yes, will do it later

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