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

Fixed #33966 -- Added support for using KeyTextTransform from lookup. #16016

Merged
merged 1 commit into from Sep 16, 2022

Conversation

AllenJonathan
Copy link
Contributor

No description provided.

Copy link
Member

@felixxm felixxm left a comment

Choose a reason for hiding this comment

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

@AllenJonathan Thanks 👍

django/db/models/fields/json.py Outdated Show resolved Hide resolved
django/db/models/fields/json.py Outdated Show resolved Hide resolved
Copy link
Member

@felixxm felixxm left a comment

Choose a reason for hiding this comment

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

@AllenJonathan Thanks 👍 I left comments, please add also a release note.

docs/topics/db/queries.txt Outdated Show resolved Hide resolved
docs/topics/db/queries.txt Outdated Show resolved Hide resolved
docs/topics/db/queries.txt Outdated Show resolved Hide resolved
def from_lookup(cls, lookup):
transform, *keys = lookup.split(LOOKUP_SEP)
if not keys:
raise ValueError("Missing keys")
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
raise ValueError("Missing keys")
raise ValueError("lookup cannot be empty.")

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Providing a non-empty lookup - giving only transform would produce this error. Wouldn't this be incorrect?

Copy link
Member

Choose a reason for hiding this comment

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

Right, maybe "lookup must contains key or index transforms." 🤔 .

tests/model_fields/test_jsonfield.py Outdated Show resolved Hide resolved
tests/model_fields/test_jsonfield.py Outdated Show resolved Hide resolved
@AllenJonathan
Copy link
Contributor Author

Just the error needs discussion. I've made all the other suggested changes.

@felixxm felixxm changed the title Fixed #33966 --Add support for using KeyTextTransform from lookup Fixed #33966 -- Added support for using KeyTextTransform from lookup. Sep 15, 2022
@felixxm
Copy link
Member

felixxm commented Sep 15, 2022

@AllenJonathan Thanks 👍

@felixxm felixxm merged commit 1017819 into django:main Sep 16, 2022
@AllenJonathan AllenJonathan deleted the ticket_33966 branch May 10, 2023 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants