Ticket #3071: context_contains.diff

File context_contains.diff, 422 bytes (added by Antti Kaihola, 18 years ago)

Adds the contains method for Context

  • template/context.py

     
    4949                return True
    5050        return False
    5151
     52    def __contains__(self, key):
     53        return self.has_key(key)
     54   
    5255    def get(self, key, otherwise=None):
    5356        for d in self.dicts:
    5457            if d.has_key(key):
Back to Top