From 22e016ff6c18a35a450519b94de63033f83e6b4f Mon Sep 17 00:00:00 2001 From: Justin Bronn Date: Thu, 28 Feb 2008 21:24:51 +0000 Subject: gis: Merged revisions 7105-7168 via svnmerge from trunk. git-svn-id: http://code.djangoproject.com/svn/django/branches/gis@7176 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/utils/datastructures.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'django/utils/datastructures.py') diff --git a/django/utils/datastructures.py b/django/utils/datastructures.py index 82d914000f..4c278c0d8e 100644 --- a/django/utils/datastructures.py +++ b/django/utils/datastructures.py @@ -3,7 +3,7 @@ class MergeDict(object): A simple class for creating new "virtual" dictionaries that actually look up values in more than one dictionary, passed in the constructor. - If a key appears in more than one of the passed in dictionaries, only the + If a key appears in more than one of the given dictionaries, only the first occurrence will be used. """ def __init__(self, *dicts): @@ -145,7 +145,7 @@ class SortedDict(dict): """Returns a copy of this object.""" # This way of initializing the copy means it works for subclasses, too. obj = self.__class__(self) - obj.keyOrder = self.keyOrder + obj.keyOrder = self.keyOrder[:] return obj def __repr__(self): @@ -155,6 +155,10 @@ class SortedDict(dict): """ return '{%s}' % ', '.join(['%r: %r' % (k, v) for k, v in self.items()]) + def clear(self): + super(SortedDict, self).clear() + self.keyOrder = [] + class MultiValueDictKeyError(KeyError): pass -- cgit v1.3