summaryrefslogtreecommitdiff
path: root/django/template/smartif.py
AgeCommit message (Collapse)Author
2026-03-12Encapsulated loop logic to avoid leaking module-level variables.Emmanuel Ferdman
2026-02-24Delete leaking loop iter vars in `smartif.py`sobolevn
While working on https://github.com/typeddjango/django-stubs/pull/3114/changes#diff-c408a224a641ee1ad26789d61b19c64c44667c1feb8fce0d58aea0338844ca66R276-R278 we have noticed that loop variables leak into the module namespace. It has two negative effects: 1. Users can access `smartif.op` and `smartif.key` public attrs, which is clearly not intenteded 2. We in `django-stubs` have to ignore these two objects from annotations Let's remove them :)
2025-07-23Refs #36500 -- Rewrapped long docstrings and block comments via a script.django-bot
Rewrapped long docstrings and block comments to 79 characters + newline using script from https://github.com/medmunds/autofix-w505.
2025-07-23Refs #36500 -- Shortened some long docstrings and comments.Mike Edmunds
Manually reformatted some long docstrings and comments that would be damaged by the to-be-applied autofixer script, in cases where editorial judgment seemed necessary for style or wording changes.
2025-07-23Removed double spaces after periods and within phrases.Sarah Boyce
2024-03-10Fixed #35286 -- Updated broken link in django/template/smartif.py docstring.umair mehmood
2024-01-26Applied Black's 2024 stable style.Mariusz Felisiak
https://github.com/psf/black/releases/tag/24.1.0
2022-02-07Refs #33476 -- Reformatted code with Black.django-bot
2017-02-17Refs #27656 -- Updated django.template/tag docstring verbs according to PEP 257.Anton Samarchyan
2017-01-19Refs #23919 -- Stopped inheriting from object to define new style classes.Simon Charette
2016-11-14Fixed #27463 -- Fixed E741 flake8 warnings.Ramin Farajpour Cami
2016-11-14Fixed E305 flake8 warnings.Ramin Farajpour Cami
2016-04-09Fixed #26479 -- Added 'is not' operator to the if tag.Alasdair Nicol
2016-04-07Removed obsolete comment in if tag.Stephen Kelly
The double equals operator was removed in 2ccfac1a651ff35cd243cd272b2202ae1ccd5740.
2016-01-22Fixed #26118 -- Added 'is' operator to if template tag.Preston Timmons
2016-01-11Added missing period to "etc.".pp
2015-09-23Refs #23913 -- Removed support for a single equals sign in {% if %} tag.Tim Graham
Per deprecation timeline.
2015-06-24Renamed RemovedInDjangoXYWarnings for new roadmap.Tim Graham
Forwardport of ae1d663b7913f6da233c55409c4973248372d302 from stable/1.8.x plus more.
2015-01-11Fixed #23913 -- Deprecated the `=` comparison in `if` template tag.Ola Sitarska
2013-11-03Fixed all E226 violationsAlex Gaynor
2013-11-02More attacking E302 violatorsAlex Gaynor
2013-11-02Correct flake8 violation E261Ray Ashman Jr
2012-06-14IfParser.next() method renamed to avoid confusion with iterator protocol.Luke Plant
2012-06-14Reverted part of 169b1a40 which was mistakenly applied to a non-iterator class.Luke Plant
Doing next(IfParser()) works for Python 2.7, because it calls IfParser.next(), but in Python 3 will call IfParser.__next__() which does not work since it is not an iterator and does not have that method.
2012-05-10Replaced foo.next() by next(foo).Claude Paroz
This new syntax for next() has been introduced in Python 2.6 and is compatible with Python 3.
2011-07-13Fixed #16225 -- Removed unused imports. Many thanks to Aymeric Augustin for ↵Jannis Leidel
the work on the patch and Alex for reviewing. git-svn-id: http://code.djangoproject.com/svn/django/trunk@16539 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-04-19Fixed #13373 -- Ensured that {% if %} statements will short circuit template ↵Russell Keith-Magee
logic and not evaluate clauses that don't require evaluation. Thanks to Jerry Stratton for the report. git-svn-id: http://code.djangoproject.com/svn/django/trunk@13001 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-03-08Fixed #13058 - "smart if" template tag doesn't support "if not in ..." ↵Luke Plant
condition Thanks to ramusus for the report. git-svn-id: http://code.djangoproject.com/svn/django/trunk@12732 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-12-09Implemented 'smart if' template tag, allowing filters and various operators ↵Luke Plant
to be used in the 'if' tag Thanks to Chris Beaven for the initial patch, Fredrik Lundh for the basis of the parser methodology and Russell Keith-Magee for code reviews. There are some BACKWARDS INCOMPATIBILITIES in rare cases - in particular, if you were using the keywords 'and', 'or' or 'not' as variable names within the 'if' expression, which was previously allowed in some cases. git-svn-id: http://code.djangoproject.com/svn/django/trunk@11806 bcc190cf-cafb-0310-a4f2-bffc1f526a37