Re: [Django] #33871: JSONField with default is not detected as changed when invalidated in inlines.

8 views
Skip to first unread message

Django

unread,
Aug 16, 2022, 8:00:07 AM8/16/22
to django-...@googlegroups.com
#33871: JSONField with default is not detected as changed when invalidated in
inlines.
-------------------------------------+-------------------------------------
Reporter: Raphael | Owner: nobody
Type: Bug | Status: new
Component: Forms | Version: 4.0
Severity: Normal | Resolution:
Keywords: JSONField | Triage Stage: Accepted
TabularInline |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by JunKi Yoon):

Replying to [comment:5 Mariusz Felisiak]:

Is this still a bug that needs to be fixed?

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

Django

unread,
Aug 16, 2022, 11:26:56 AM8/16/22
to django-...@googlegroups.com
#33871: JSONField with default is not detected as changed when invalidated in
inlines.
-------------------------------------+-------------------------------------
Reporter: Raphael | Owner: nobody
Type: Bug | Status: new
Component: Forms | Version: 4.0
Severity: Normal | Resolution:
Keywords: JSONField | Triage Stage: Accepted
TabularInline |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak):

Replying to [comment:6 JunKi Yoon]:


> Is this still a bug that needs to be fixed?

Yes, it's waiting for a patch.

--
Ticket URL: <https://code.djangoproject.com/ticket/33871#comment:7>

Django

unread,
Aug 17, 2022, 5:54:39 AM8/17/22
to django-...@googlegroups.com
#33871: JSONField with default is not detected as changed when invalidated in
inlines.
-------------------------------------+-------------------------------------
Reporter: Raphael | Owner: JunKi
| Yoon
Type: Bug | Status: assigned

Component: Forms | Version: 4.0
Severity: Normal | Resolution:
Keywords: JSONField | Triage Stage: Accepted
TabularInline |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by JunKi Yoon):

* owner: nobody => JunKi Yoon
* status: new => assigned


Comment:

Replying to [comment:7 Mariusz Felisiak]:

Ok, I will try. Thank you for reply :)

--
Ticket URL: <https://code.djangoproject.com/ticket/33871#comment:8>

Django

unread,
Aug 17, 2022, 6:29:40 AM8/17/22
to django-...@googlegroups.com
#33871: JSONField with default is not detected as changed when invalidated in
inlines.
-------------------------------------+-------------------------------------
Reporter: Raphael | Owner: JunKi
| Yoon
Type: Bug | Status: assigned
Component: Forms | Version: 4.0
Severity: Normal | Resolution:
Keywords: JSONField | Triage Stage: Accepted
TabularInline |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by JunKi Yoon):

Replying to [ticket:33871 Raphael], [ticket:33871 Mariusz Felisiak]:

Hi, Raphael. I want to patch this issue.

1. So, Could you plz give me the URL for the basic Django tutorial ?

2. And, I downloaded your attachments. I have a question about sequence
you wrote. Did you run it from the admin page ? or Django shell ?

3. Did you mean, right?
{{{
two TextField -> Question.question_text, Choice.choice_text,
one JsonField -> Choice.test
}}}

How can I reproduce ?

--
Ticket URL: <https://code.djangoproject.com/ticket/33871#comment:9>

Django

unread,
Aug 17, 2022, 7:19:51 AM8/17/22
to django-...@googlegroups.com
#33871: JSONField with default is not detected as changed when invalidated in
inlines.
-------------------------------------+-------------------------------------
Reporter: Raphael | Owner: JunKi
| Yoon
Type: Bug | Status: assigned
Component: Forms | Version: 4.0
Severity: Normal | Resolution:
Keywords: JSONField | Triage Stage: Accepted
TabularInline |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Raphael):

Hello,

1. So, Could you plz give me the URL for the basic Django tutorial ?

--- https://docs.djangoproject.com/en/4.1/intro/tutorial01/

2. And, I downloaded your attachments. I have a question about sequence
you wrote. Did you run it from the admin page ? or Django shell ?

-- Admin page

3. Did you mean, right?

-- I didn't really understand the question, but in the sample I attached
is another field. I don't think this is relevant to the problem. I think
it's easier for you to use the sample I sent.

How can I reproduce ?

Run the code and follow the Sequence. You will see that the data will not
be store correctly.

Thank you.

Replying to [comment:9 JunKi Yoon]:
> Replying to [ticket:33871 Raphael], [comment:7 Mariusz Felisiak]:


>
> Hi, Raphael. I want to patch this issue.
>
> 1. So, Could you plz give me the URL for the basic Django tutorial ?
>
> 2. And, I downloaded your attachments. I have a question about sequence
you wrote. Did you run it from the admin page ? or Django shell ?
>
> 3. Did you mean, right?
> {{{
> two TextField -> Question.question_text, Choice.choice_text,
> one JsonField -> Choice.test
> }}}
>
> How can I reproduce ?

--
Ticket URL: <https://code.djangoproject.com/ticket/33871#comment:10>

Django

unread,
Aug 18, 2022, 8:30:03 AM8/18/22
to django-...@googlegroups.com
#33871: JSONField with default is not detected as changed when invalidated in
inlines.
-------------------------------------+-------------------------------------
Reporter: Raphael | Owner: JunKi
| Yoon
Type: Bug | Status: assigned
Component: Forms | Version: 4.0
Severity: Normal | Resolution:
Keywords: JSONField | Triage Stage: Accepted
TabularInline |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by JunKi Yoon):

Replying to [comment:5 Mariusz Felisiak]:

Hi Mariusz Felisiak :)

After debugging, I confirmed that the **initial-choice_set-0-test** and
**choice_set-0-test** are same.

So, I guess one thing. **initial-choice_set-0-test** is not the value that
the Choice object currently has.
**initial-choice_set-0-test** value after showing error message by
sequence 8 is stored as the input value in sequence 6.

Could you plz give me some advice regarding where to set the initial-XXX-
XXX and code?

Thank you.

cc) [comment:10 Raphael]


> Thanks for the detailed report. `initial` value is set to a new value
when invalidated, that's why changes are not detected:
> {{{
> choice_set-0-test="test 123"
> initial-choice_set-0-test="test 123"
> }}}

--
Ticket URL: <https://code.djangoproject.com/ticket/33871#comment:11>

Django

unread,
Sep 25, 2022, 9:25:29 AM9/25/22
to django-...@googlegroups.com
#33871: JSONField with default is not detected as changed when invalidated in
inlines.
-------------------------------------+-------------------------------------
Reporter: Raphael | Owner: JunKi
| Yoon
Type: Bug | Status: assigned
Component: Forms | Version: 4.0
Severity: Normal | Resolution:
Keywords: JSONField | Triage Stage: Accepted
TabularInline |
Has patch: 1 | Needs documentation: 0

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

* has_patch: 0 => 1


Comment:

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

--
Ticket URL: <https://code.djangoproject.com/ticket/33871#comment:12>

Django

unread,
Oct 6, 2022, 10:30:49 AM10/6/22
to django-...@googlegroups.com
#33871: JSONField with default is not detected as changed when invalidated in
inlines.
-------------------------------------+-------------------------------------
Reporter: Raphael | Owner: JunKi
| Yoon
Type: Bug | Status: assigned
Component: Forms | Version: 4.0
Severity: Normal | Resolution:
Keywords: JSONField | Triage Stage: Accepted
TabularInline |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Carlton Gibson):

* needs_better_patch: 0 => 1


Comment:

Current patch is mixing solution between forms and admin components.
Slightly clearer tests showing the problem would probably clarify.

--
Ticket URL: <https://code.djangoproject.com/ticket/33871#comment:13>

Django

unread,
Oct 14, 2022, 5:55:45 AM10/14/22
to django-...@googlegroups.com
#33871: JSONField with default is not detected as changed when invalidated in
inlines.
-------------------------------------+-------------------------------------
Reporter: Raphael | Owner: JunKi
| Yoon
Type: Bug | Status: assigned
Component: Forms | Version: 4.0
Severity: Normal | Resolution:
Keywords: JSONField | Triage Stage: Accepted
TabularInline |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by JunKi Yoon):

Replying to [comment:13 Carlton Gibson]:


> Current patch is mixing solution between forms and admin components.
Slightly clearer tests showing the problem would probably clarify.

I Improved patch and tests. :)

--
Ticket URL: <https://code.djangoproject.com/ticket/33871#comment:14>

Django

unread,
Nov 2, 2022, 6:13:02 AM11/2/22
to django-...@googlegroups.com
#33871: JSONField with default is not detected as changed when invalidated in
inlines.
-------------------------------------+-------------------------------------
Reporter: Raphael | Owner: JunKi
| Yoon
Type: Bug | Status: closed
Component: Forms | Version: 4.0
Severity: Normal | Resolution: duplicate
Keywords: JSONField | Triage Stage:
TabularInline | Unreviewed

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

* status: assigned => closed
* resolution: => duplicate
* stage: Accepted => Unreviewed


Comment:

Duplicate of #34119.

--
Ticket URL: <https://code.djangoproject.com/ticket/33871#comment:15>

Django

unread,
Nov 2, 2022, 1:19:27 PM11/2/22
to django-...@googlegroups.com
#33871: JSONField with default is not detected as changed when invalidated in
inlines.
-------------------------------------+-------------------------------------
Reporter: Raphael | Owner: JunKi
| Yoon
Type: Bug | Status: closed
Component: Forms | Version: 4.0
Severity: Normal | Resolution: duplicate
Keywords: JSONField | Triage Stage:
TabularInline | Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by David Sanders):

Confirmed the patch for #34119 fixes the issue with sample models provided
and steps described above.

--
Ticket URL: <https://code.djangoproject.com/ticket/33871#comment:16>

Reply all
Reply to author
Forward
0 new messages