Skip to content

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