Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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
  • Loading branch information...
commit 9ed4217a57efc498e60bb3a2a10c57acc1ee6962 1 parent ce9aca5
Malcolm Tredinnick authored May 19, 2007
4  django/http/__init__.py
@@ -121,9 +121,9 @@ def update(self, other_dict):
121 121
         self._assert_mutable()
122 122
         MultiValueDict.update(self, other_dict)
123 123
 
124  
-    def pop(self, key):
  124
+    def pop(self, key, *args):
125 125
         self._assert_mutable()
126  
-        return MultiValueDict.pop(self, key)
  126
+        return MultiValueDict.pop(self, key, *args)
127 127
 
128 128
     def popitem(self):
129 129
         self._assert_mutable()
3  tests/regressiontests/httpwrappers/tests.py
@@ -166,6 +166,9 @@
166 166
 >>> q.pop('foo')
167 167
 ['bar', 'baz', 'another', 'hello']
168 168
 
  169
+>>> q.pop('foo', 'not there')
  170
+'not there'
  171
+
169 172
 >>> q.get('foo', 'not there')
170 173
 'not there'
171 174
 

0 notes on commit 9ed4217

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