mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #13092 -- Added support for the "in" operator when dealing with context lists. Thanks to clelland for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@13510 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -19,6 +19,12 @@ class ContextList(list):
|
||||
else:
|
||||
return super(ContextList, self).__getitem__(key)
|
||||
|
||||
def __contains__(self, key):
|
||||
try:
|
||||
value = self[key]
|
||||
except KeyError:
|
||||
return False
|
||||
return True
|
||||
|
||||
def instrumented_test_render(self, context):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user