summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2007-02-10 09:02:00 +0000
committerMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2007-02-10 09:02:00 +0000
commit4d75c7aa6ef7a477697fbe06658d8bd5ab2d0250 (patch)
treee8637759ef7275681967ec9c520d8719356dd848
parentd8deb0c61cdcd99ed2cede8d65d4fd30458f4dbc (diff)
Fixed #3071 -- added a {{{__contains__}}} method to the Context class. Thanks
akaihola. git-svn-id: http://code.djangoproject.com/svn/django/trunk@4480 bcc190cf-cafb-0310-a4f2-bffc1f526a37
-rw-r--r--django/template/context.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/django/template/context.py b/django/template/context.py
index ba23e95ab7..25397b0e1a 100644
--- a/django/template/context.py
+++ b/django/template/context.py
@@ -49,6 +49,9 @@ class Context(object):
return True
return False
+ def __contains__(self, key):
+ return self.has_key(key)
+
def get(self, key, otherwise=None):
for d in self.dicts:
if d.has_key(key):