summaryrefslogtreecommitdiff
path: root/django/http
diff options
context:
space:
mode:
authorRussell Keith-Magee <russell@keith-magee.com>2007-09-11 13:36:09 +0000
committerRussell Keith-Magee <russell@keith-magee.com>2007-09-11 13:36:09 +0000
commitdb01d1d0a8b1d584b025164988de8003c2d29d1c (patch)
tree5d4b3b37966a20196802b652274b4278fc5ea423 /django/http
parent7115465afa549955ec446638e0d73b597e6ffd20 (diff)
Fixed #5318 -- Added __contains__ method to HttpRequest, mirroring existing has_key method. Thanks for the patch, robbie@prelab.net.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6097 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/http')
-rw-r--r--django/http/__init__.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/django/http/__init__.py b/django/http/__init__.py
index 7cd47481dc..0e1c2a0fbb 100644
--- a/django/http/__init__.py
+++ b/django/http/__init__.py
@@ -38,9 +38,12 @@ class HttpRequest(object):
return d[key]
raise KeyError, "%s not found in either POST or GET" % key
- def has_key(self, key):
+ def __contains__(self, key):
return key in self.GET or key in self.POST
+ def has_key(self, key):
+ return key in self
+
def get_full_path(self):
return ''