Kaydet (Commit) 9ed4217a authored tarafından Malcolm Tredinnick's avatar Malcolm Tredinnick

Fixed #4337 -- Added pop() method to QueryDict. Thanks, Gary Wilson.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@5289 bcc190cf-cafb-0310-a4f2-bffc1f526a37
üst ce9aca58
......@@ -121,9 +121,9 @@ class QueryDict(MultiValueDict):
self._assert_mutable()
MultiValueDict.update(self, other_dict)
def pop(self, key):
def pop(self, key, *args):
self._assert_mutable()
return MultiValueDict.pop(self, key)
return MultiValueDict.pop(self, key, *args)
def popitem(self):
self._assert_mutable()
......
......@@ -166,6 +166,9 @@ True
>>> q.pop('foo')
['bar', 'baz', 'another', 'hello']
>>> q.pop('foo', 'not there')
'not there'
>>> q.get('foo', 'not there')
'not there'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment