summaryrefslogtreecommitdiff
path: root/django/template/context.py
AgeCommit message (Collapse)Author
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-03-01Applied Black's 2025 stable style.Mariusz Felisiak
https://github.com/psf/black/releases/tag/25.1.0
2024-11-18Refs #35844 -- Fixed copying BaseContext and its subclasses on Python 3.14+.Mariusz Felisiak
super objects are copyable on Python 3.14+: https://github.com/python/cpython/commit/5ca4e34bc1aab8321911aac6d5b2b9e75ff764d8 and can no longer be used in BaseContext.__copy__().
2024-06-13Fixed #35417 -- Updated BaseContext.new() with values to create a context ↵George Y. Kussumoto
that can be flattened.
2023-03-29Fixed #34427 -- Improved error message when context processor does not ↵David Sanders
return a dict.
2022-02-07Refs #33476 -- Reformatted code with Black.django-bot
2019-10-01Fixed #30651 -- Made __eq__() methods return NotImplemented for not ↵ElizabethU
implemented comparisons. Changed __eq__ to return NotImplemented instead of False if compared to an object of the same type, as is recommended by the Python data model reference. Now these models can be compared to ANY (or other objects with __eq__ overwritten) without returning False automatically.
2018-07-11Simplified BaseContext.__iter__().Sergey Fedoseev
2017-12-26Fixed #28930 -- Simplified code with any() and all().Дилян Палаузов
2017-09-28Simplified various __eq__() methods.Mads Jensen
2017-05-27Fixed #28249 -- Removed unnecessary dict.keys() calls.Jon Dufresne
iter(dict) is equivalent to iter(dict.keys()).
2017-03-25Fixed #27956 -- Fixed display of errors in an {% extends %} child.Tim Graham
Thanks Ling-Xiao Yang for the report and test, and Preston Timmons for the fix.
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-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-17Refs #26263 -- Removed deprecated Context.has_key().Tim Graham
2016-12-28Fixed #27258 -- Prohibited django.Template.render() with non-dict context.Shivang Bharadwaj
Thanks Shivang Bharadwaj for the initial patch.
2016-12-20Fixed #27584 -- Fixed display of render time template errors.Preston Timmons
2016-08-09Fixed #26830 -- Prevented the 'with' templatetag from resetting the cycle ↵Alexander Schrijver
variable to its initial state.
2016-02-23Fixed #26263 -- Deprecated Context.has_key()Tim Graham
2015-11-12Fixed #25469 -- Added autoescape option to DjangoTemplates backend.Aaron Elliot Ross
Thanks Aymeric for the initial patch and Carl for review.
2015-09-23Removed current_app argument to render() and TemplateResponse().Tim Graham
Per deprecation timeline.
2015-09-11Fixed #24765 -- Allowed template context updates to flatten a Context.Buddy Lindsey, Jr
2015-07-27Fixed #24127 -- Changed the default current_app to the current namespace.Marten Kenbeek
Changed the url template tag to use request.resolver_match.namespace as a default for the current_app argument if request.current_app is not set.
2015-06-24Renamed RemovedInDjangoXYWarnings for new roadmap.Tim Graham
Forwardport of ae1d663b7913f6da233c55409c4973248372d302 from stable/1.8.x plus more.
2015-05-27Fixed #24847 -- Prevented items set on a RequestContext from being lost.Paweł Marczewski
2015-04-14Fixed #24603 -- Allowed Context.update() to be used as a context manager.Tommy Beadle
2015-03-27Fixed #18773 -- Added logging for template variable resolvingCaroline Simpson
Added a django.template logger without a default handler. Added logging if there is an exception while resolving variables in a template.
2015-03-16Fixed #24493 -- Added BaseContext.setdefault()Preston Timmons
2015-02-20Removed a non-obvious side-effect of assigning Context.template.Aymeric Augustin
Explicit is better than implicit.
2015-02-19Set context.template instead of context.engine while rendering.Aymeric Augustin
This opens more possibilities, like accessing context.template.origin. It also follows the chain of objects instead of following a shortcut.
2015-02-10Split DTL context creation into its own function.Aymeric Augustin
This reduces the length of rope RequestContext gives users to hang themselves with. Thanks Alex Hill for the report and Tim Graham for the review.
2015-02-06Sorted imports with isort; refs #23860.Tim Graham
2015-02-05Fixed #24273 -- Allowed copying RequestContext more than once.Aymeric Augustin
Thanks Collin Anderson for the report.
2014-12-28Deprecated TEMPLATE_CONTEXT_PROCESSORS.Aymeric Augustin
2014-12-28Deprecated current_app in TemplateResponse and render(_to_response).Aymeric Augustin
2014-12-28Simplified implementation of django.shortcuts.render(_to_response).Aymeric Augustin
*args, **kwargs brought more confusion than concision.
2014-12-28Moved context_processors from django.core to django.template.Aymeric Augustin
2014-11-23Encapsulated TEMPLATE_CONTEXT_PROCESSORS in Engine.Aymeric Augustin
Since RequestContext doesn't know its Engine until it's passed to Template.render() -- and cannot without breaking a widely used public API -- an elaborate hack is required to apply context processors.
2014-11-23Added to each Context a reference to the Engine.Aymeric Augustin
It's only available during the rendering.
2014-11-19Simplified caching of template context processors.Aymeric Augustin
2014-11-15Fixed #23585 - Corrected internal comment.Grzegorz Slusarek
Removed misleading comment and provide correct one, explaining idea behind hardcoded CSRF template context processor.
2014-02-16Made the new template.Context.flatten() method a public API.Marek Wywiał
That method was introduced in 9db4271bd11ac23a5a5652bbcdf8fb6d4b997651. Refs #21765.
2014-02-15Fixed bad comparison logic introduced in ↵Baptiste Mispelon
d97bf2e9c8971764690caaf81a0914bc368d6b02. Refs #21765. Thanks to kezabelle for the quick report and to onjin for providing the patch.
2014-02-15Fixed #21765 -- Added support for comparing Context instancesMarek Wywiał
2014-02-08Fixed #21674 -- Deprecated the import_by_path() function in favor of ↵Berker Peksag
import_string(). Thanks Aymeric Augustin for the suggestion and review.
2013-12-19Small flake8 fixes -- number of blank lines between top level definitionsAlex Gaynor
2013-12-20Fixed #21639 -- Implemented RenderContext.__getitem__Alex Hill
It's now consistent with RenderContext.get.
2013-11-02Fixed the remaining E302 violations int eh django packageAlex Gaynor