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.
* 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>
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>
* 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>
* needs_docs: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/33966#comment:4>
* 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>
* 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>