Re: Commitable json dumps

2017-03-07 Thread Adam Johnson
Wait, I just looked into this further, and discovered that the ordering of fields was made deterministic for all serializers in #24558 - this was released in Django 1.9! Enjoy👌 On 7 March 2017 at 22:23, Adam Johnson wrote: > Ah yes, PyYAML just does

Re: Commitable json dumps

2017-03-07 Thread Adam Johnson
Ah yes, PyYAML just does this. It can be disabled by passing a different option to yaml.dump (I think default_flow_style=False) but that would be similar to changing the JSON serializer.. On 6 March 2017 at 16:53, Brice PARENT wrote: > > Le 06/03/17 à 15:44, Brice PARENT a écrit : > >> Le 06/03/

Re: Commitable json dumps

2017-03-06 Thread Adam Johnson
PyYAML sorts keys by default, so if you use the YAML serializer that should work for your usecase. I think patching the JSON serializer to be deterministic by default is a good idea, the performance cost of sorting keys is pretty small compared to disk operations. On 6 March 2017 at 11:32, Brice