Use JSON canonical form for Dict value
It allows to make equality comparison. issue7013 review39041002
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
* Use JSON canonical form for Dict value
|
||||
* Remove rules on user
|
||||
* Add monetary formatting to language
|
||||
* Add exceptional parent language
|
||||
|
||||
@@ -37,7 +37,9 @@ class Dict(Field):
|
||||
if value is None:
|
||||
return None
|
||||
assert isinstance(value, dict)
|
||||
return json.dumps(value, cls=JSONEncoder, separators=(',', ':'))
|
||||
# Use canonical form
|
||||
return json.dumps(
|
||||
value, cls=JSONEncoder, separators=(',', ':'), sort_keys=True)
|
||||
|
||||
def translated(self, name=None, type_='values'):
|
||||
"Return a descriptor for the translated value of the field"
|
||||
|
||||
Reference in New Issue
Block a user