[Django] #33966: Add support for using KeyTextTransform from lookup

18 views
Skip to first unread message

Django

unread,
Aug 30, 2022, 6:46:13 AM8/30/22
to django-...@googlegroups.com
#33966: Add support for using KeyTextTransform from lookup
-------------------------------------+-------------------------------------
Reporter: | Owner: nobody
AllenJonathan |
Type: New | Status: new
feature |
Component: Database | Version: dev
layer (models, ORM) |
Severity: Normal | Keywords:
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
Currently, we use nested objects to transform through a JSON field. For
example, for
`json = {'a': {'b': 'boat`}}`

Here, to get 'boat` in text form we use:-
`KeyTextTransform(KeyTextTransform('a', 'json_field'), 'b')`
This would return 'boat' in text form.

A better UX would be:
`KeyTextTransform('json__a__b`)`

--
Ticket URL: <https://code.djangoproject.com/ticket/33966>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Aug 30, 2022, 6:49:49 AM8/30/22
to django-...@googlegroups.com
#33966: Add support for using KeyTextTransform from lookup
-------------------------------------+-------------------------------------
Reporter: AllenJonathan | Owner: nobody
Type: New feature | Status: new
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* cc: Simon Charette (added)
* stage: Unreviewed => Accepted


Old description:

> Currently, we use nested objects to transform through a JSON field. For
> example, for
> `json = {'a': {'b': 'boat`}}`
>
> Here, to get 'boat` in text form we use:-
> `KeyTextTransform(KeyTextTransform('a', 'json_field'), 'b')`
> This would return 'boat' in text form.
>
> A better UX would be:
> `KeyTextTransform('json__a__b`)`

New description:

Currently, we use nested objects to transform through a JSON field. For
example, for
`json = {'a': {'b': 'boat`}}`

Here, to get 'boat` in text form we use:-
`KeyTextTransform(KeyTextTransform('a', 'json_field'), 'b')`
This would return 'boat' in text form.

A better UX would be:

`KeyTextTransform('json_field__a__b`)`

--

--
Ticket URL: <https://code.djangoproject.com/ticket/33966#comment:1>

Django

unread,
Aug 30, 2022, 7:37:34 AM8/30/22
to django-...@googlegroups.com
#33966: Add support for using KeyTextTransform from lookup
-------------------------------------+-------------------------------------
Reporter: AllenJonathan | Owner: nobody
Type: New feature | Status: new
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Description changed by AllenJonathan:

Old description:

> Currently, we use nested objects to transform through a JSON field. For
> example, for
> `json = {'a': {'b': 'boat`}}`
>
> Here, to get 'boat` in text form we use:-
> `KeyTextTransform(KeyTextTransform('a', 'json_field'), 'b')`
> This would return 'boat' in text form.
>
> A better UX would be:

> `KeyTextTransform('json_field__a__b`)`

New description:

Currently, we use nested objects to transform through a JSON field. For
example, for
`json = {'a': {'b': 'boat'}}`

Here, to get 'boat` in text form we use:-
`KeyTextTransform(KeyTextTransform('a', 'json_field'), 'b')`
This would return 'boat' in text form.

A better UX would be:
`KeyTextTransform('json_field__a__b')`

--

--
Ticket URL: <https://code.djangoproject.com/ticket/33966#comment:2>

Django

unread,
Sep 5, 2022, 7:14:37 AM9/5/22
to django-...@googlegroups.com
#33966: Add support for using KeyTextTransform from lookup
-------------------------------------+-------------------------------------
Reporter: AllenJonathan | Owner:
| AllenJonathan
Type: New feature | Status: assigned

Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* owner: nobody => AllenJonathan
* needs_better_patch: 0 => 1
* has_patch: 0 => 1
* status: new => assigned
* needs_tests: 0 => 1


Comment:

[https://github.com/django/django/pull/16016 PR]

--
Ticket URL: <https://code.djangoproject.com/ticket/33966#comment:3>

Django

unread,
Sep 14, 2022, 2:58:50 AM9/14/22
to django-...@googlegroups.com
#33966: Add support for using KeyTextTransform from lookup
-------------------------------------+-------------------------------------
Reporter: AllenJonathan | Owner:
| AllenJonathan
Type: New feature | Status: assigned
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1

Needs tests: 1 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* needs_docs: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/33966#comment:4>

Django

unread,
Sep 15, 2022, 2:52:36 PM9/15/22
to django-...@googlegroups.com
#33966: Add support for using KeyTextTransform from lookup
-------------------------------------+-------------------------------------
Reporter: AllenJonathan | Owner:
| AllenJonathan
Type: New feature | Status: assigned
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* needs_better_patch: 1 => 0
* stage: Accepted => Ready for checkin
* needs_tests: 1 => 0
* needs_docs: 1 => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/33966#comment:5>

Django

unread,
Sep 16, 2022, 12:14:08 AM9/16/22
to django-...@googlegroups.com
#33966: Add support for using KeyTextTransform from lookup
-------------------------------------+-------------------------------------
Reporter: AllenJonathan | Owner:
| AllenJonathan
Type: New feature | Status: closed

Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak <felisiak.mariusz@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"10178197d57476f69688d4535e550a1ea3a5eac5" 10178197]:
{{{
#!CommitTicketReference repository=""
revision="10178197d57476f69688d4535e550a1ea3a5eac5"
Fixed #33966 -- Added support for using KeyTextTransform from lookup.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/33966#comment:6>

Reply all
Reply to author
Forward
0 new messages