diff options
Diffstat (limited to 'django/utils/datastructures.py')
-rw-r--r-- | django/utils/datastructures.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/django/utils/datastructures.py b/django/utils/datastructures.py index 2b19c06dfb..cca30b462d 100644 --- a/django/utils/datastructures.py +++ b/django/utils/datastructures.py @@ -99,6 +99,13 @@ class SortedDict(dict): obj.keyOrder = self.keyOrder return obj + def __repr__(self): + """ + Replaces the normal dict.__repr__ with a version that returns the keys + in their sorted order. + """ + return '{%s}' % ', '.join(['%r: %r' % (k, v) for k, v in self.items()]) + class MultiValueDictKeyError(KeyError): pass |