#35149: JSONField db_default requires wrapping values in json.dumps()
-------------------------------------+-------------------------------------
     Reporter:  David Sanders        |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:  Database layer       |                  Version:  5.0
  (models, ORM)                      |
     Severity:  Release blocker      |               Resolution:
     Keywords:  JSONField            |             Triage Stage:  Accepted
  db_default                         |
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Comment (by Simon Charette):

 > If someone provided supplied an expression without an output_field, and
 it's not resolvable, should your cached property try to set it?

 I feel like implicit `output_field` assignment only makes sense in a
 context where we offer no way for the user to set it such as when they
 provide a non-expression themselves. In all other cases the user can
 provide an explicit `output_field` so it feels like we'd be guessing for
 them.

 > Also should there be a check to warn if someone supplied an expression
 with a resolved type not matching the field?

 That's a good one. I'd say we might want to consider a check in future
 versions but not necessarily backport such check to 5.0 and have this work
 included as part of this ticket?

 > Simon, David, thanks for the details so far! Would any of you be
 available to provide a fix for this?

 I'm happy to provide a fix myself or let someone familiar with the
 `db_default` work do it as well and provide a review. Were you interested
 in taking the work when you reported the issue David?
-- 
Ticket URL: <https://code.djangoproject.com/ticket/35149#comment:6>
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018d583e367e-6aafcdfe-ef9b-44a7-9894-a5a0ce1aae3d-000000%40eu-central-1.amazonses.com.

Reply via email to