mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
Refs #23913 -- Removed support for a single equals sign in {% if %} tag.
Per deprecation timeline.
This commit is contained in:
@@ -1,17 +1,13 @@
|
||||
"""
|
||||
Parser and utilities for the smart 'if' tag
|
||||
"""
|
||||
import warnings
|
||||
|
||||
from django.utils.deprecation import RemovedInDjango110Warning
|
||||
|
||||
|
||||
# Using a simple top down parser, as described here:
|
||||
# http://effbot.org/zone/simple-top-down-parsing.htm.
|
||||
# 'led' = left denotation
|
||||
# 'nud' = null denotation
|
||||
# 'bp' = binding power (left = lbp, right = rbp)
|
||||
|
||||
|
||||
class TokenBase(object):
|
||||
"""
|
||||
Base class for operators and literals, mainly for debugging and for throwing
|
||||
@@ -102,8 +98,6 @@ 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)),
|
||||
# This should be removed in Django 1.10:
|
||||
'=': 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)),
|
||||
'>': infix(10, lambda context, x, y: x.eval(context) > y.eval(context)),
|
||||
@@ -178,11 +172,6 @@ class IfParser(object):
|
||||
except (KeyError, TypeError):
|
||||
return self.create_var(token)
|
||||
else:
|
||||
if token == '=':
|
||||
warnings.warn(
|
||||
"Operator '=' is deprecated and will be removed in Django 1.10. Use '==' instead.",
|
||||
RemovedInDjango110Warning, stacklevel=2
|
||||
)
|
||||
return op()
|
||||
|
||||
def next_token(self):
|
||||
|
||||
Reference in New Issue
Block a user