You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Django
I have an application where we've upgraded from Django 1.7 to 1.9 that makes extensive use of the new Postgres JSONField type. Now that JSONField is native to Django I'm trying to get it to work with our existing code base. We have a class that won't automatically serialize to json so I've extended the JSONField class with a new JSONSerializedField which basically attempts to call to_json() and from_json() methods on objects if it can.
By overloading get_prep_value() I've been able to handle the python->json conversion. I'm having trouble figuring out what I need to overload to handle the json->python conversion, however. Overloading to_python() doesn't seem to work as my method is never called. How can I achieve what my to_python method is trying to accomplish with the new JSONField?