From c00ae7f58c34962ed6dbec4eb8aaf747da59ed2f Mon Sep 17 00:00:00 2001 From: Preston Timmons Date: Thu, 21 Jan 2016 21:50:06 -0600 Subject: Fixed #26118 -- Added 'is' operator to if template tag. --- django/template/smartif.py | 1 + 1 file changed, 1 insertion(+) (limited to 'django') diff --git a/django/template/smartif.py b/django/template/smartif.py index a3c1f37973..1433a8499a 100644 --- a/django/template/smartif.py +++ b/django/template/smartif.py @@ -98,6 +98,7 @@ OPERATORS = { 'not': prefix(8, lambda context, x: not x.eval(context)), 'in': infix(9, lambda context, x, y: x.eval(context) in y.eval(context)), 'not in': infix(9, lambda context, x, y: x.eval(context) not in y.eval(context)), + 'is': infix(10, lambda context, x, y: x.eval(context) is y.eval(context)), '==': infix(10, lambda context, x, y: x.eval(context) == y.eval(context)), '!=': infix(10, lambda context, x, y: x.eval(context) != y.eval(context)), '>': infix(10, lambda context, x, y: x.eval(context) > y.eval(context)), -- cgit v1.3