diff options
| author | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2007-05-19 18:34:00 +0000 |
|---|---|---|
| committer | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2007-05-19 18:34:00 +0000 |
| commit | 9ed4217a57efc498e60bb3a2a10c57acc1ee6962 (patch) | |
| tree | 7e6e19b71fcd4e97dca2b75feea24076e1e32912 | |
| parent | ce9aca58235903926c9aa314a26d36ccf62d9680 (diff) | |
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
| -rw-r--r-- | django/http/__init__.py | 4 | ||||
| -rw-r--r-- | tests/regressiontests/httpwrappers/tests.py | 3 |
2 files changed, 5 insertions, 2 deletions
diff --git a/django/http/__init__.py b/django/http/__init__.py index 74a4eff55c..ca3b5eab24 100644 --- a/django/http/__init__.py +++ b/django/http/__init__.py @@ -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() diff --git a/tests/regressiontests/httpwrappers/tests.py b/tests/regressiontests/httpwrappers/tests.py index c8016bc5bd..e7245104e9 100644 --- a/tests/regressiontests/httpwrappers/tests.py +++ b/tests/regressiontests/httpwrappers/tests.py @@ -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' |
