summaryrefslogtreecommitdiff
path: root/django/template/library.py
AgeCommit message (Collapse)Author
2025-12-05Fixed #36728 -- Validated template tag arguments at definition time.Jake Howard
Before, `context` and `content` were validated at compile time.
2025-12-01Fixed #36712 -- Evaluated type annotations lazily in template tag registration.Jacob Walls
Ideally, this will be reverted when an upstream solution is available for https://github.com/python/cpython/issues/141560. Thanks Patrick Rauscher for the report and Augusto Pontes for the first iteration and test.
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-23Removed double spaces after periods and within phrases.Sarah Boyce
2025-03-31Refs #28909 -- Simplified code using unpacking generalizations.Aarni Koskela
2024-11-19Fixed #35535 -- Added template tag decorator simple_block_tag().Jake Howard
Co-authored-by: Natalia <124304+nessita@users.noreply.github.com>
2023-11-24Fixed #34983 -- Deprecated django.utils.itercompat.is_iterable().Nick Pope
2022-05-25Normalized imports of functools.wraps.Aymeric Augustin
@wraps is 10 times more common than @functools.wraps. Standardize to the most common version.
2022-02-07Refs #33476 -- Reformatted code with Black.django-bot
2022-01-10Simplified @stringfilter decorator and Library with unwrap().Baptiste Mispelon
Nowadays we can use inspect.unwrap() to retrieve the innermost function object when needed, and most of the uses of _decorated_function were to access the original __name__ which is not needed because @functools.wraps sets that attribute correctly.
2021-08-19Fixed #33036 -- Made simple_tag()/inclusion_tag() with takes_context raise ↵Matt Westcott
TemplateSyntaxError when function has no parameters.
2021-08-02Fixed #32919 -- Optimized lexing & parsing of templates.Keryn Knight
This optimizes: - Lexer.create_token() by avoiding startswith() calls, - Parser.parse() by re-using the token type enum's value, - Parser.extend_nodelist() by removing unnecessary isinstance() check, - some Node subclasses by removing the implicit "nodelist" from "child_nodelists", - Variable.__init__() by avoiding startswith() calls.
2020-01-02Fixed #31128 -- Fixed TemplateSyntaxError in simple_tag() and ↵Patrick Seebauer
inclusion_tag() for kwargs.
2019-05-17Fixed #30453 -- Fixed crash of simple_tag() and inclusion_tag() when ↵Batuhan Taşkaya
function is wrapped. getfullargspec() doesn't work with wrapped functions.
2017-05-11Fixed #28129 -- Allowed custom template tags to use keyword-only arguments.Alexander Allakhverdiyev
2017-04-27Replaced django.utils.inspect.getargspec() with inspect.getfullargspec().Alexander Allakhverdiyev
2017-01-25Refs #23919 -- Replaced super(ClassName, self) with super().chillaranand
2017-01-19Refs #23919 -- Stopped inheriting from object to define new style classes.Simon Charette
2017-01-18Refs #23919 -- Removed six.<various>_types usageClaude Paroz
Thanks Tim Graham and Simon Charette for the reviews.
2017-01-17Refs #18651 -- Removed assignment_tag per deprecation timeline.Tim Graham
2016-04-08Fixed E128 flake8 warnings in django/.Tim Graham
2015-06-29Fixed #25018 -- Changed simple_tag to apply conditional_escape() to its output.Luke Plant
This is a security hardening fix to help prevent XSS (and incorrect HTML) for the common use case of simple_tag. Thanks to Tim Graham for the review.
2015-06-24Renamed RemovedInDjangoXYWarnings for new roadmap.Tim Graham
Forwardport of ae1d663b7913f6da233c55409c4973248372d302 from stable/1.8.x plus more.
2015-06-15Fixed #24979 -- Removed usage of inspect.getargspec().Tim Graham
2015-05-21Fixed #17085, #24783 -- Refactored template library registration.Preston Timmons
* Converted the ``libraries`` and ``builtins`` globals of ``django.template.base`` into properties of the Engine class. * Added a public API for explicit registration of libraries and builtins.