#29147: Postgres JSONField missing to_python
-------------------------------------+-------------------------------------
     Reporter:  Javier Buzzi         |                    Owner:  Williams
                                     |  Mendez
         Type:  Bug                  |                   Status:  closed
    Component:  contrib.postgres     |                  Version:  1.9
     Severity:  Normal               |               Resolution:  invalid
     Keywords:                       |             Triage Stage:
                                     |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  1                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Javier Buzzi):

 @Tim, nothing that i can see.

 We need this for Aloe, we have a string table to load data for our tests
 and we rely heavily on the field's ability to turn a raw/string value to a
 python value.

 Example:


 {{{
 from django.db.models import BooleanField, CharField, NumberField
 from django.contrib.postgres import fields

 CharField.to_python(None, 'hello')
 'hello'
 IntegerField.to_python(None, '123')
 123
 BooleanField.to_python(None, 'True')
 True
 fields.HStoreField.to_python(None, '{"hello": "world"}')
 {'hello': 'world'}
 }}}

 The only thing that breaks that pattern in the entire lib, is `JSONField`:

 {{{
 fields.JSONField.to_python(None, '{"hello": "world"}')
 '{"hello": "world"}'
 }}}

-- 
Ticket URL: <https://code.djangoproject.com/ticket/29147#comment:9>
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 post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/069.89c812950aee1b45d71db1173744ce11%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to