Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Primary Support of UniqueConstraint#7438

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
auvipy merged 1 commit intoencode:masterfromkalekseev:feature/unique-constraint
Mar 3, 2023

Conversation

kalekseev
Copy link
Contributor

@kalekseevkalekseev commentedJul 29, 2020
edited
Loading

A starting point for discussion, that pr supports both cases when UniqueConstraint consist of one field ->UniqueValidator, and several fields ->UniqueTogetherValidator. The implementation of single field unique validator is quite naive where we loop over all constraints searching for single field constraints and we do it for each field, would be good to cache that somehow.

refs#7173

auvipy, georgek, JorgenPhi, baseplate-admin, brucedesa, and shun198 reacted with hooray emojisandrofolk reacted with eyes emoji
@kalekseev
Copy link
ContributorAuthor

@carltongibson@tomchristie can we add this to 3.12 milestone? I'm ready to contribute updates to the patch as requested.

@carltongibson
Copy link
Collaborator

Hi@kalekseev. Yes. Super. It's just waiting for a bit of capacity to review. Thanks 👍

@NyanKiyoshi
Copy link

I believe a test case for the serializer error message would be good to have to ensure the message is as expected. Currently it seems like any message is "good enough" which might cause unwanted/unexpected effects

auvipy reacted with thumbs up emoji

@tomchristietomchristie modified the milestones:3.13 Release,3.14Jan 10, 2022
@stale
Copy link

stalebot commentedMar 27, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stalestalebot added the stale labelMar 27, 2022
@kalekseev
Copy link
ContributorAuthor

It's not stale, still waiting review from maintainers.

@stalestalebot removed the stale labelMar 27, 2022
@stale
Copy link

stalebot commentedMay 31, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stalestalebot added the stale labelMay 31, 2022
@JorgenPhi
Copy link

Bump

@stalestalebot removed the stale labelMay 31, 2022
@kalekseevkalekseevforce-pushed thefeature/unique-constraint branch 2 times, most recently from12c78c9 tofdcd9efCompareMay 31, 2022 14:07
@carltongibson
Copy link
Collaborator

Just to comment to re-flag this as a change worth having. ORMConstraints are getting increasingly rounded out, and as such are the expected API going forward.

@stale
Copy link

stalebot commentedAug 13, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stalestalebot added the stale labelAug 13, 2022
@kalekseev
Copy link
ContributorAuthor

Not stale, I will rebase as soon as someone is ready to review. Probably can be superseded by#7173 (comment)

@stalestalebot removed the stale labelAug 15, 2022
@auvipy
Copy link
Member

Not stale, I will rebase as soon as someone is ready to review. Probably can be superseded by#7173 (comment)

so drf level validation might not needed?

@stale
Copy link

stalebot commentedNov 1, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@auvipy
Copy link
Member

as we still support django 3.0, so we might still follow the approach in this PR. considering the fact that django orm level validation is available in 4.1 mostly.

@stale
Copy link

stalebot commentedJan 21, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stalestalebot added the stale labelJan 21, 2023
Copy link
Member

@auvipyauvipy left a comment

Choose a reason for hiding this comment

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

if you can fix the merge conflicts it would be really great

@kalekseevkalekseevforce-pushed thefeature/unique-constraint branch fromfdcd9ef to6ce7d29CompareJanuary 25, 2023 17:05
@kalekseev
Copy link
ContributorAuthor

@auvipy rebased

@auvipy
Copy link
Member

I will review it timorrow

@auvipyauvipy self-requested a reviewJanuary 25, 2023 17:18
@auvipy
Copy link
Member

@auvipy rebased

can we checkhttps://docs.djangoproject.com/en/4.0/ref/models/constraints/ and see if we could cover more test cases/edge cases here?

@kalekseev
Copy link
ContributorAuthor

@auvipy rebased

can we checkhttps://docs.djangoproject.com/en/4.0/ref/models/constraints/ and see if we could cover more test cases/edge cases here?

The pr lack of support for *expressions that were added recently, I will look into it when I have time.

auvipy reacted with thumbs up emoji

@auvipy
Copy link
Member

@auvipy rebased

can we checkhttps://docs.djangoproject.com/en/4.0/ref/models/constraints/ and see if we could cover more test cases/edge cases here?

The pr lack of support for *expressions that were added recently, I will look into it when I have time.

If you can handle the new API's in this PR it would be really great.

@kalekseev
Copy link
ContributorAuthor

@auvipy this is in my backlog, unfortunately I'm crushed with work right now, not sure when I'll be able to review it

as we still support django 3.0, so we might still follow the approach in this PR. considering the fact that django orm level validation is available in 4.1 mostly.

Is there a work done to introduce support for new django validation into DRF?

@auvipy
Copy link
Member

not really. in that case we can move forward with the current implementation of this patch for now and implement the new API's in another take.

@auvipyauvipy changed the titleSupport UniqueConstraintPrimary Support of UniqueConstraintMar 3, 2023
@auvipyauvipy merged commitb7523f4 intoencode:masterMar 3, 2023
micahjsmith pushed a commit to openevidence/django-rest-framework that referenced this pull requestApr 6, 2023
lunika added a commit to openfun/marsha that referenced this pull requestJul 3, 2024
In DRF 3.15 they added, in the serializer validator, the modelconstraint validation. With the playlist model, we have to force thelti_id default value and manage better in the test the constraintbetween organization or consumer_site existence with the lti_id.Seeencode/django-rest-framework#7438
lunika added a commit to openfun/marsha that referenced this pull requestJul 4, 2024
In DRF 3.15 they added, in the serializer validator, the modelconstraint validation. With the playlist model, we have to force thelti_id default value and manage better in the test the constraintbetween organization or consumer_site existence with the lti_id.Seeencode/django-rest-framework#7438
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@auvipyauvipyauvipy approved these changes

@tomchristietomchristieAwaiting requested review from tomchristie

Assignees
No one assigned
Projects
None yet
Milestone
3.15
Development

Successfully merging this pull request may close these issues.

6 participants
@kalekseev@carltongibson@NyanKiyoshi@JorgenPhi@auvipy@tomchristie

[8]ページ先頭

©2009-2025 Movatter.jp