#34500: use annotate return feild, Error capture does not work
-------------------------------------+-------------------------------------
     Reporter:  ajinwu               |                    Owner:  ajinwu
         Type:  Bug                  |                   Status:  closed
    Component:  Database layer       |                  Version:  4.2
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:  duplicate
     Keywords:  json decode          |             Triage Stage:
                                     |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  1                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

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


Comment:

 `JSONField.from_db_value()` is a part of Django internals and it works as
 expected. `value` returned from a database should be a string. If you want
 to use `Func()` which returns a type other than the field you passed in,
 you should use the `output_field` argument, e.g.
 {{{
 Func(F('field'), function='jsonb_array_length',
 output_field=IntegerField())
 }}}

 Duplicate of #31973.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/34500#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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/010701878e481725-bd2fb629-da65-4fb0-8f7c-61161f0cc724-000000%40eu-central-1.amazonses.com.

Reply via email to