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
This commit is contained in:
parent
7115465afa
commit
db01d1d0a8
|
@ -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 ''
|
||||
|
||||
|
|
Loading…
Reference in New Issue