1
0
mirror of https://github.com/django/django.git synced 2025-10-30 00:56:09 +00:00

Fixed #17229 -- Allow 'True', 'False' and 'None' to resolve to the corresponding Python objects in templates.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@17894 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Aymeric Augustin
2012-04-10 20:49:45 +00:00
parent 28e5b66518
commit 93240b7d90
5 changed files with 30 additions and 12 deletions

View File

@@ -18,7 +18,10 @@ class BaseContext(object):
self._reset_dicts(dict_)
def _reset_dicts(self, value=None):
self.dicts = [value or {}]
builtins = {'True': True, 'False': False, 'None': None}
if value:
builtins.update(value)
self.dicts = [builtins]
def __copy__(self):
duplicate = copy(super(BaseContext, self))