Re: unexpected JSONField behavior clarification - key value pairs initially loaded integers, then saved down as strings into the database

2018-05-07 Thread Oliver Zhou
Thanks for the reply! I accidentally posted this twice. Still seems like it should raise some sort of warning or exception when you're trying to edit both an integer key and a string key at the same time, instead of just allowing for seemingly non-deterministic data loss. On Sunday, May 6,

Re: unexpected JSONField behavior clarification - key value pairs initially loaded integers, then saved down as strings into the database

2018-05-06 Thread Peter of the Norse
This is actually part of the JSON specification . All of the keys must be strings. If you put in an int or float, it will automatically convert it, but that is something you have to watch out for since it can lead to data loss. >>> import json

unexpected JSONField behavior clarification - key value pairs initially loaded integers, then saved down as strings into the database

2018-04-24 Thread Oliver Zhou
Using Django 1.11, Python 2.7, PostGres, and JSONField I'm getting behavior I don't expect. It seems when JSONField values are initially saved/accessed in memory, they're python "integers", but when saved to the database and then re-accessed, the values are now in string format. *What about