Ticket #5138: HttpRequest-contains.patch

File HttpRequest-contains.patch, 533 bytes (added by robbie@…, 11 years ago)

Patch to add contains method to HttpResquest

  • django/http/__init__.py

     
    3838                return d[key]
    3939        raise KeyError, "%s not found in either POST or GET" % key
    4040
    41     def has_key(self, key):
     41    def __contains__(self, key):
    4242        return key in self.GET or key in self.POST
    4343
     44    def has_key(self, key):
     45        return key in self
     46
    4447    def get_full_path(self):
    4548        return ''
    4649
Back to Top