#34539: `get_prep_value` no longer called for JSONField
-------------------------------------+-------------------------------------
     Reporter:  Julie Rymer          |                    Owner:  Julie
                                     |  Rymer
         Type:  Bug                  |                   Status:  new
    Component:  Database layer       |                  Version:  4.2
  (models, ORM)                      |
     Severity:  Release blocker      |               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 Shaheed Haque):

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


Comment:

 This has caused a behaviour change for me which I **think** may be a
 regression. I'm not especially knowledgeable about the issues debated
 above, but here is what I see. First, I am using an add-on app called
 social_django which sets a JSONField and then saves the value here:

 https://github.com/python-social-auth/social-app-
 
django/blob/8d0a2052d1b22a899454571c62237d23aa25af97/social_django/storage.py#L24

 Second, on the stack, I have the frames show in the attachment "stack
 frame", and the important point is that when I enter the two new lines of
 code added, value is a dict, but the value is flattened into a string by
 the new code.

 The result is that the database JSONField has the saved string. **I
 believe that to be incorrect**. Previously, the dict was saved as
 expected.

 (Perhaps the intent  here was to only have this change apply to subclasses
 of JSONField?)

 Advice appreciated.

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

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/010701889bade52d-418af280-36a6-4f3e-9ce2-d0299e41bcab-000000%40eu-central-1.amazonses.com.

Reply via email to