Skip to content
Browse files

Added SortedDict.value_for_index() method in django.utils.datastructures

git-svn-id: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent 93eebd9 commit c770803f72bf6f0c7dc773ab41b674c6532ae756 @adrianholovaty adrianholovaty committed
Showing with 5 additions and 1 deletion.
  1. +5 −1 django/utils/
6 django/utils/
@@ -70,7 +70,7 @@ def keys(self):
return self.keyOrder[:]
def values(self):
- return [dict.__getitem__(self,k) for k in self.keyOrder]
+ return [dict.__getitem__(self, k) for k in self.keyOrder]
def update(self, dict):
for k, v in dict.items():
@@ -81,6 +81,10 @@ def setdefault(self, key, default):
return dict.setdefault(self, key, default)
+ def value_for_index(self, index):
+ "Returns the value of the item at the given zero-based index."
+ return self[self.keyOrder[index]]
class MultiValueDictKeyError(KeyError):

0 comments on commit c770803

Please sign in to comment.
Something went wrong with that request. Please try again.