1
0
mirror of https://github.com/django/django.git synced 2025-10-26 23:26:08 +00:00

Fixed #26118 -- Added 'is' operator to if template tag.

This commit is contained in:
Preston Timmons
2016-01-21 21:50:06 -06:00
committed by Tim Graham
parent a08d2463d2
commit c00ae7f58c
4 changed files with 25 additions and 1 deletions

View File

@@ -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)),