From 4d75c7aa6ef7a477697fbe06658d8bd5ab2d0250 Mon Sep 17 00:00:00 2001 From: Malcolm Tredinnick Date: Sat, 10 Feb 2007 09:02:00 +0000 Subject: [PATCH] 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 --- django/template/context.py | 3 +++ 1 file changed, 3 insertions(+) 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):