Arthur de Jong

Open Source / Free Software developer

summaryrefslogtreecommitdiffstats
path: root/django/template
Commit message (Collapse)AuthorAgeFilesLines
...
* Removed cases of six.iter* wrapped in a list()Curtis Maloney2015-04-181-1/+1
| | | | | There's absolutely no advantage [and a mild performance hit] to using six.iter* in these cases.
* Fixed #24603 -- Allowed Context.update() to be used as a ↵Tommy Beadle2015-04-141-2/+1
| | | | context manager.
* Fixed #12199 -- Added the ability to use "as" with the ↵Craig Oldford2015-04-141-4/+14
| | | | firstof template tag.
* Updated docstring for firstof tag to reflect new ↵Preston Timmons2015-04-031-4/+8
| | | | auto-escaping behavior.
* Fixed #23441, #24555 -- Improved the behavior of ↵Preston Timmons2015-04-011-3/+9
| | | | | | | | | | | InclusionNode. This change: * Makes the InclusionNode cache-safe by removing render-time side effects to its nodelist. * Ensures the render_context stack is properly scoped and reset by updating the render call to use Template.render rather than Nodelist.render.
* Fixed #24538 -- Allowed self in Jinja contextTim Heap2015-04-011-1/+1
| | | | | | Rendering a Jinja template with self in the context threw an error. While self is a reserved variable in Jinja, including self in the context is not an error, so Django should respect that.
* Fixed #18773 -- Added logging for template variable ↵Caroline Simpson2015-03-282-0/+8
| | | | | | | | resolving Added a django.template logger without a default handler. Added logging if there is an exception while resolving variables in a template.
* Cleaned up the template debug implementation.Preston Timmons2015-03-205-204/+242
| | | | | | | | | | | | | | | | | | | | | | | | | This patch does three major things: * Merges the django.template.debug implementation into django.template.base. * Simplifies the debug implementation. The old implementation copied debug information to every token and node. The django_template_source attribute was set in multiple places, some quite hacky, like django.template.defaulttags.ForNode. Debug information is now annotated in two high-level places: * Template.compile_nodelist for errors during parsing * Node.render_annotated for errors during rendering These were chosen because they have access to the template and context as well as to all exceptions that happen during either the parse or render phase. * Moves the contextual line traceback information creation from django.views.debug into django.template.base.Template. The debug views now only deal with the presentation of the debug information.
* Fixed typo in escape_filter() docstring.Jon Walsh2015-03-191-1/+1
|
* Fixed #24493 -- Added BaseContext.setdefault()Preston Timmons2015-03-161-0/+7
|
* Fed tuples to startswith when appropriateClaude Paroz2015-03-131-1/+1
|
* Fixed #24464 -- Made built-in HTML template filter ↵Erik Romijn2015-03-091-7/+7
| | | | | | | | | | functions escape their input by default. This may cause some backwards compatibility issues, but may also resolve security issues in third party projects that fail to heed warnings in our documentation. Thanks Markus Holtermann for help with tests and docs.
* Fixed #24451 -- Deprecated comma-separated {% cycle %} ↵Tim Graham2015-03-071-0/+4
| | | | syntax.
* Fixed #24399 -- Made filesystem loaders use more ↵Preston Timmons2015-03-031-2/+4
| | | | specific exceptions.
* Fixed #24372 - Replaced TokenParser usage with ↵Preston Timmons2015-03-031-116/+0
| | | | traditional parsing.
* Used dict comprehension in URLNodeCorey Farwell2015-03-021-2/+4
| | | | | 4468c08d7 replaced a lot of the old `dict()` comprehensions with the new style, but missed this one.
* Fixed #24409 -- Combined the app_directories and ↵Preston Timmons2015-03-022-40/+10
| | | | | | | filesystem loader implementation. Besides the directories they look in, these two loaders are functionally the same. This removes unnecessary code duplication between the two.
* Removed a non-obvious side-effect of assigning ↵Aymeric Augustin2015-02-202-33/+38
| | | | | | Context.template. Explicit is better than implicit.
* Set context.template instead of context.engine while ↵Aymeric Augustin2015-02-194-31/+37
| | | | | | | | rendering. This opens more possibilities, like accessing context.template.origin. It also follows the chain of objects instead of following a shortcut.
* Refs #24324 -- Fixed crash in {% debug %} tag on Python 2.Tim Graham2015-02-181-1/+1
| | | | | If Django is installed in a path that contains non-ASCII characters, the tag failed with UnicodeDecodeError.
* Refs #24324 -- Fixed get_app_template_dirs() ↵Tim Graham2015-02-171-7/+3
| | | | | | | UnicodeDecodeError on Python 2. The function implemented most of upath(), but skipped the check for strings that are already unicode.
* Removed unnecessary __init__ definition from DebugLexer.Preston Timmons2015-02-161-3/+0
|
* Deprecated TEMPLATE_DEBUG setting.Aymeric Augustin2015-02-153-3/+4
|
* Fixed #24338 -- Accepted Template wrapper in {% extends %}.Aymeric Augustin2015-02-141-3/+8
| | | | | | | | Explicitly checking for django.template.Template subclasses is preferrable to duck-typing because both the django.template.Template and django.template.backends.django.Template have a render() method. Thanks spectras for the report.
* Split DTL context creation into its own function.Aymeric Augustin2015-02-102-10/+18
| | | | | | | 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.
* Simplified the lazy CSRF token implementation in csrf ↵Alex Gaynor2015-02-081-4/+2
| | | | | | | | context processor. This significantly improves performance on PyPy. The previous implementation would generate a new class on every single request, which is relatively slow.
* Fixed E265 comment styleCollin Anderson2015-02-061-2/+2
|
* Sorted imports with isort; refs #23860.Tim Graham2015-02-0615-72/+75
|
* Fixed #24265 -- Preserved template backend loading ↵Aymeric Augustin2015-02-051-0/+4
| | | | | | | exceptions. If importing or initializing a template backend fails, attempting to access this template backend again must raise the same exception.
* Fixed #24273 -- Allowed copying RequestContext more than ↵Aymeric Augustin2015-02-051-1/+2
| | | | | | once. Thanks Collin Anderson for the report.
* Fixed #24235 -- Removed is_usable attribute from ↵Preston Timmons2015-02-047-29/+15
| | | | template loaders.
* Fixed #18651 -- Enabled optional assignments for ↵Preston Timmons2015-02-031-49/+30
| | | | simple_tag().
* Fixed #24168 -- Allowed selecting a template engine in a ↵Aymeric Augustin2015-02-031-5/+8
| | | | | | | | | | | | few APIs. Specifically in rendering shortcuts, template responses, and class-based views that return template responses. Also added a test for render_to_response(status=...) which was missing from fdbfc980. Thanks Tim and Carl for the review.
* Fixed typo in 'Django Template Language'David Robles2015-01-171-1/+1
|
* Accounted for multiple template engines in template ↵Aymeric Augustin2015-01-121-32/+61
| | | | responses.
* Deprecated passing a Context to a generic Template.render.Aymeric Augustin2015-01-122-2/+35
| | | | | | | | | | | A deprecation path is required because the return type of django.template.loader.get_template changed during the multiple template engines refactor. test_csrf_token_in_404 was incorrect: it tested the case when the hardcoded template was rendered, and that template doesn't depend on the CSRF token. This commit makes it test the case when a custom template is rendered.
* Rewrapped TemplateSyntaxError in Jinja2 backend.Aymeric Augustin2015-01-121-6/+8
| | | | | Changed import style to avoid confusion between Django's and Jinja2's APIs.
* Fixed #23913 -- Deprecated the `=` comparison in `if` ↵Ola Sitarska2015-01-112-1/+10
| | | | template tag.
* Added a request argument to render_to_string.Aymeric Augustin2015-01-071-2/+7
| | | | | | | This is for consistency with Template.render. It adds a little bit of knowledge about HTTP requests in django.template.loader but I think consistency trumps purity.
* Exposed Engine in the django.template namespace.Aymeric Augustin2015-01-072-4/+7
| | | | It's the main entrypoint to the refactored template system.
* Made context take priority over context processors.Aymeric Augustin2015-01-061-1/+7
| | | | | | | | | This is the expected behavior, but given RequestContext's tortuous implementation, a straightforward use of its API results in the opposite. This commits fixes a regression that must have happened at different points in the multiple templates engine refactor for different features.
* Added comments to remove Engine.render_to_string in ↵Aymeric Augustin2015-01-062-9/+9
| | | | | | | Django 2.0. Since this is a private API introduced in Django 1.8, no documentation is required.
* Fixed #24022 -- Deprecated the ssi tag.Preston Timmons2015-01-061-0/+5
|
* Explained the structure of django.template.Aymeric Augustin2014-12-281-0/+41
|
* Raised a warning when using the legacy TEMPLATE_* settings.Aymeric Augustin2014-12-281-8/+6
| | | | All tests now rely on TEMPLATES.
* Deprecated TEMPLATE_CONTEXT_PROCESSORS.Aymeric Augustin2014-12-282-3/+4
|
* Raised an error when allowed_include_roots is a string.Aymeric Augustin2014-12-281-1/+5
| | | | | | This avoids leaving projects silently vulnerable when this option is set to a string instead of a one-item tuple containing that string, a very common misconfiguration.
* Deprecated current_app in TemplateResponse and ↵Aymeric Augustin2014-12-283-12/+46
| | | | render(_to_response).
* Preserved context class in inclusion_tag.Aymeric Augustin2014-12-281-8/+2
| | | | | | | | | | Previously, when a template was rendered with RequestContext, inclusion tags were rendered with a plain context, losing additional information available in the RequestContext. The (admittedly bizarre) implementation of RequestContext.new() has the side-effect of not running template context processors, making this change backwards-compatible.
* Simplified implementation of ↵Aymeric Augustin2014-12-281-2/+8
| | | | | | django.shortcuts.render(_to_response). *args, **kwargs brought more confusion than concision.