Skip to content

Commit

Permalink
Fixed #5318 -- Added __contains__ method to HttpRequest, mirroring ex…
Browse files Browse the repository at this point in the history
…isting 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
  • Loading branch information
freakboy3742 committed Sep 11, 2007
1 parent 7115465 commit db01d1d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion django/http/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,12 @@ def __getitem__(self, key):
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 ''

Expand Down

0 comments on commit db01d1d

Please sign in to comment.