mirror of
https://github.com/django/django.git
synced 2025-10-26 15:16:09 +00:00
Fixed #3964 -- Added a custom SortedDict.__repr__ so that the keys are printed
in sorted order. Based on a patch from Forest Bond. git-svn-id: http://code.djangoproject.com/svn/django/trunk@5069 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user