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

Followup to set_context removal #7076

Merged
merged 4 commits into from Dec 11, 2019
Merged

Conversation

@rpkilby
Copy link
Member

@rpkilby rpkilby commented Dec 5, 2019

Hi @tomchristie. Just a review/followup for #7062.

  • Bump deprecation from 3.12 to 3.13 to be inline with our stated deprecation policy.
  • Raise RemovedInDRF313Warning instead of DeprecationWarning.
  • In some methods, pass the serializer instead of the model instance. This is necessary in order to correctly handle field source mappings (will followup in a separate PR). Also, this signature was introduced in #7062, so breaking it now isn't an API breakage.
  • Change instance = getattr(serializer, 'instance', None) to just serializer.instance. The BaseSerializer declares instance, so I'm not aware of a case where it wouldn't exist.
  • Remove the validator .serializer_field, which is a holdover from set_context.
rpkilby added 4 commits Dec 5, 2019
- Use `RemovedInDRF313Warning` instead of DeprecationWarning
- Update to follow deprecation policy
The `UniqueTogetherValidator` may need to access attributes on the
serializer instead of just the model instance. For example, this is
useful for handling field sources.
@tomchristie
Copy link
Member

@tomchristie tomchristie commented Dec 11, 2019

Thanks!

@tomchristie tomchristie merged commit de9f1d5 into encode:master Dec 11, 2019
1 check passed
@rpkilby rpkilby deleted the unique-together-updates branch Dec 11, 2019
pchiquet pushed a commit to pchiquet/django-rest-framework that referenced this issue Nov 17, 2020
* Raise framework-specific deprecation warnings

- Use `RemovedInDRF313Warning` instead of DeprecationWarning
- Update to follow deprecation policy

* Pass serializer instead of model to validator

The `UniqueTogetherValidator` may need to access attributes on the
serializer instead of just the model instance. For example, this is
useful for handling field sources.

* Fix framework deprecation warning in test

* Remove outdated validator attribute
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants