Added SortedDict.value_for_index() method in django.utils.datastructures
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4373 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
93eebd95cb
commit
c770803f72
|
@ -81,6 +81,10 @@ class SortedDict(dict):
|
||||||
self.keyOrder.append(key)
|
self.keyOrder.append(key)
|
||||||
return dict.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):
|
class MultiValueDictKeyError(KeyError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue