summaryrefslogtreecommitdiff
path: root/django/template/base.py
AgeCommit message (Collapse)Author
2020-05-11Refs #30116 -- Simplified regex match group access with Match.__getitem__().Jon Dufresne
The method has been available since Python 3.6. The shorter syntax is also marginally faster.
2019-12-10Used Signature API instead of deprecated inspect.getcallargs().Baptiste Mispelon
inspect.getcallargs() was deprecated in Python 3.5 and the Signature API (PEP 362) has better support for decorated functions (by default, it follows the __wrapped__ attribute set by functools.wraps for example).
2019-12-10Used full module import for inspect in template/base.py.Baptiste Mispelon
2019-10-29Fixed #30899 -- Lazily compiled import time regular expressions.Hasan Ramezani
2019-10-09Improved performance of django.template.base.Parser.Alex Gaynor
pop(0), which is used to fetch each token, is O(n) in the length of the list. By reversing the list and operating off the end, we can perform next_token(), prepend_token(), and delete_first_token() in constant time.
2019-10-02Fixed some typos in comments and docs.Min ho Kim
Thanks to Mads Jenson for review.
2019-09-24Removed some outdated backwards compatibility imports and misleading comments.Mads Jensen
EmptyResultSet moved in 46509cf13dbf049f75077981c29ef2c60b5a96ab. FieldDoesNotExist moved in 8958170755b37ce346ae5257c1000bd936faa3b0. BoundField and pretty_name moved in 8550161e531a603d57723850fb09c4c9b7ca60b9. EMPTY_VALUES moved in 471596fc1afcb9c6258d317c619eaf5fd394e797. BaseRunserverCommand moved in 5c53e30607014163872e89c221b206992a9acfef.
2019-05-07Removed unnecessary line in DebugLexer.tokenize().sanchjat
2018-08-01Fixed typos in comments and docs.luz.paz
2018-07-31Fixed #29617 -- Fixed Template crash if template_string is lazy.Dražen Odobašić
Regression in 3a148f958dddd97c1379081118c30fbede6b6bc4.
2018-05-25Fixed #29400 -- Fixed crash in custom template filters that use decorated ↵Ryan Rubin
functions. Regression in 620e9dd31a2146d70de740f96a8cb9a6db054fc7.
2018-05-10Replaced TOKEN_* constants by TokenType enums.Claude Paroz
Thanks Tim Graham for the review.
2018-03-24Removed unnecessary variable in Lexer.create_token().Mads Jensen
2017-10-21Fixed #28730 -- Fixed loss of precision for large integer literals in templatesClaude Paroz
Thanks Fraser Nevett for the report and Tim Graham for patch edits.
2017-09-28Simplified various __eq__() methods.Mads Jensen
2017-08-23Removed unneeded iter() calls.Sergey Fedoseev
A few of these were unnecessarily added in 2b281cc35ed9d997614ca3c416928d7fabfef1ad.
2017-04-27Replaced django.utils.inspect.getargspec() with inspect.getfullargspec().Alexander Allakhverdiyev
2017-02-23Refs #23919 -- Used yield from.Vytis Banaitis
2017-02-17Refs #27656 -- Updated django.template/tag docstring verbs according to PEP 257.Anton Samarchyan
2017-02-07Refs #27795 -- Removed force_text from the template layerClaude Paroz
Thanks Tim Graham for the review.
2017-02-07Converted usage of ugettext* functions to their gettext* aliasesClaude Paroz
Thanks Tim Graham for the review.
2017-02-06Fixed #27783 -- Switched VariableDoesNotExist.__str__() to repr() context.Ryan O’Hara
Using __str__() and then repr'ing the result looks strange and can lead to recursive rendering of forms.
2017-01-26Refs #23919, #27778 -- Removed obsolete mentions of unicode.Vytis Banaitis
2017-01-25Removed unused variables that are overwritten.Mads Jensen
2017-01-21Refs #23919 -- Removed re.U and re.UNICODE (default on Python 3).Mariusz Felisiak
2017-01-20Refs #23919 -- Removed unneeded force_str callsClaude Paroz
2017-01-19Refs #23919 -- Stopped inheriting from object to define new style classes.Simon Charette
2017-01-18Refs #23919 -- Removed obsolete __ne__() methods.Aymeric Augustin
__ne__() defaults to the opposite of __eq__() on Python 3 when it doesn't return NotImplemented.
2017-01-18Refs #23919 -- Removed six.<various>_types usageClaude Paroz
Thanks Tim Graham and Simon Charette for the reviews.
2017-01-18Refs #23919 -- Removed python_2_unicode_compatible decorator usageClaude Paroz
2017-01-18Refs #23919 -- Removed encoding preambles and future importsClaude Paroz
2017-01-17Refs #24046 -- Removed mark_for_escaping() per deprecation timeline.Tim Graham
2017-01-17Refs #25466 -- Removed aliases for LoaderOrigin and StringOrigin.Tim Graham
Per deprecation timeline.
2016-12-20Fixed #27584 -- Fixed display of render time template errors.Preston Timmons
2016-11-14Fixed E305 flake8 warnings.Ramin Farajpour Cami
2016-09-17Refs #27025 -- Fixed "invalid escape sequence" warnings in Python 3.6.Tim Graham
http://bugs.python.org/issue27364
2016-08-31Fixed #27140 -- Prevented template rendering from hiding a property's TypeError.Tim Graham
2016-05-10Fixed #24046 -- Deprecated the "escape" half of utils.safestring.Tim Graham
2016-05-09Refs #24046 -- Removed redundant condition in render_value_in_context()Tim Graham
Calling conditional_escape() on SafeData won't change it.
2016-04-09Fixed #26403 -- Removed translated content in "Invalid block tag" message.amureki
2016-01-26Fixed #25848 -- Set template origin on each node.Preston Timmons
Prior to 55f12f8709, the template origin was available on each node via `self.token.source[0]`. This behavior was removed when debug handling was simplified, but 3rd-party debugging tools still depend on its presence. This updates the Parser to set origin on individual nodes. This enables the source template to be determined even when template extending or including is used.
2015-12-03Fixed #25825 -- Implemented __ne__() for template OriginJaap Roes
2015-12-03Fixed many spelling mistakes in code, comments, and docs.Josh Soref
2015-11-26Fixed a typo in the template Parser.parse docstring.Jaap Roes
2015-10-05Fixed #25423 -- Made error message for unknown template tag more helpful.Pindi Albert
2015-09-29Fixed #25466 -- Added backwards compatibility aliases for LoaderOrigin and ↵Tim Graham
StringOrigin. Thanks Simon Charette for the DeprecationInstanceCheck class.
2015-09-23Refs #22933 -- Removed template.resolve_variable() per deprecation timeline.Tim Graham
2015-09-21Refs #18773 -- Improved template variable exception logging message.Nick Johnson
2015-09-15Fixed #25404 -- Added line numbers to TemplateSyntaxError strings.Dave Smith
This makes it much easier to diagnose a test failure when all you have is the stack trace from an uncaught TemplateSyntaxError.
2015-08-12Fixed #24257 -- Corrected i18n handling of percent signs.Doug Beck
Refactored tests to use a sample project. Updated extraction: * Removed special handling of single percent signs. * When extracting messages from template text, doubled all percent signs so they are not interpreted by gettext as string format flags. All strings extracted by gettext, if containing a percent sign, will now be labeled "#, python-format". Updated translation: * Used "%%" for "%" in template text before calling gettext. * Updated {% trans %} rendering to restore "%" from "%%".