From 9ed4217a57efc498e60bb3a2a10c57acc1ee6962 Mon Sep 17 00:00:00 2001 From: Malcolm Tredinnick Date: Sat, 19 May 2007 18:34:00 +0000 Subject: [PATCH] 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 --- django/http/__init__.py | 4 ++-- 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'