Skip to content

[3.15] Add functions related to UniqueConstraint #591

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

Merged
merged 3 commits into from
Apr 16, 2024

Conversation

JaeHyuckSa
Copy link
Contributor

I have made things!

I added functions related to UniqueConstraint function in DRF version 3.15.

  • field_mapping.get_unique_validators
  • ModelSerializer.get_unique_together_constraints

Related issues

Upstream PR: encode/django-rest-framework#7438

Copy link
Member

@sobolevn sobolevn left a comment

Choose a reason for hiding this comment

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

And the same for all other Generator usages :)

@@ -253,6 +253,9 @@ class ModelSerializer(Serializer, BaseSerializer[_MT]):
self, kwargs: MutableMapping[str, Any], extra_kwargs: MutableMapping[str, Any]
) -> MutableMapping[str, Any]: ...
def get_extra_kwargs(self) -> dict[str, Any]: ...
def get_unique_together_constraints(
self, model: _MT
) -> Generator[tuple[set[tuple[str, ...]], Manager[_MT]], None, None]: ...
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
) -> Generator[tuple[set[tuple[str, ...]], Manager[_MT]], None, None]: ...
) -> Iterator[tuple[set[tuple[str, ...]], Manager[_MT]], None, None]: ...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@sobolevn Thank you very much for your feedback :) I have made the necessary revisions based on your input!

Copy link
Member

@sobolevn sobolevn left a comment

Choose a reason for hiding this comment

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

Thanks!

@sobolevn sobolevn merged commit 373b63c into typeddjango:master Apr 16, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants