From 2b82a3bcfc757c2bdafca6c5d9930201deed00cf Mon Sep 17 00:00:00 2001 From: Gary Wilson Jr Date: Sat, 16 Aug 2008 02:17:55 +0000 Subject: Fixed #7331 -- Made `QueryDict.iteritems` behave like `QueryDict.items`, thanks jurev. git-svn-id: http://code.djangoproject.com/svn/django/trunk@8399 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/utils/datastructures.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'django/utils') diff --git a/django/utils/datastructures.py b/django/utils/datastructures.py index f27bc1cfff..818731ba04 100644 --- a/django/utils/datastructures.py +++ b/django/utils/datastructures.py @@ -266,6 +266,14 @@ class MultiValueDict(dict): """ return [(key, self[key]) for key in self.keys()] + def iteritems(self): + """ + Yields (key, value) pairs, where value is the last item in the list + associated with the key. + """ + for key in self.keys(): + yield (key, self[key]) + def lists(self): """Returns a list of (key, list) pairs.""" return super(MultiValueDict, self).items() -- cgit v1.3