| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
tag more helpful.
|
|
|
|
|
|
| |
for LoaderOrigin and StringOrigin.
Thanks Simon Charette for the DeprecationInstanceCheck class.
|
|
|
|
| |
deprecation timeline.
|
|
|
|
| |
logging message.
|
|
|
|
|
|
|
| |
TemplateSyntaxError strings.
This makes it much easier to diagnose a test failure when all
you have is the stack trace from an uncaught TemplateSyntaxError.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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 "%%".
|
| |
|
|
|
|
|
|
| |
template.base.ALLOWED_VARIABLE_CHARS.
Unused since 5d863f1fbd26537a8bca2920bc591279d15fbdf1.
|
| |
|
|
|
|
|
| |
Forwardport of ae1d663b7913f6da233c55409c4973248372d302
from stable/1.8.x plus more.
|
| |
|
|
|
|
|
|
|
|
| |
registration.
* 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.
|
| |
|
|
|
|
|
|
|
|
| |
django.template.exceptions.
With the introduction of multiple template engines these exceptions are no
longer DTL-specific. It makes more sense for them to be moved out of
DTL-related modules.
|
|
|
|
| |
template backends.
|
| |
|
|
|
|
|
| |
There's absolutely no advantage [and a mild performance hit] to using six.iter*
in these cases.
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
| |
resolving
Added a django.template logger without a default handler. Added
logging if there is an exception while resolving variables in a
template.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
traditional parsing.
|
|
|
|
|
|
| |
Context.template.
Explicit is better than implicit.
|
|
|
|
|
|
|
|
| |
rendering.
This opens more possibilities, like accessing context.template.origin.
It also follows the chain of objects instead of following a shortcut.
|
| |
|
|
|
|
| |
simple_tag().
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
| |
select_template.
This commit changes the return type of these two functions. Instead of
returning a django.template.Template they return a backend-specific
Template class that must implement render(self, context).
|
|
|
|
| |
django.template.loader.
|
|
|
|
|
|
|
|
|
| |
Since this package is going to hold both the implementation of the Django
Template Language and the infrastructure for Multiple Template Engines,
it should be untied from the DTL as much as possible within our
backwards-compatibility policy.
Only public APIs (i.e. APIs mentioned in the documentation) were left.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
libs in Django.
Refs #7261 -- Made strings escaped by Django usable in third-party libs.
The changes in mark_safe and mark_for_escaping are straightforward. The
more tricky part is to handle correctly objects that implement __html__.
Historically escape() has escaped SafeData. Even if that doesn't seem a
good behavior, changing it would create security concerns. Therefore
support for __html__() was only added to conditional_escape() where this
concern doesn't exist.
Then using conditional_escape() instead of escape() in the Django
template engine makes it understand data escaped by other libraries.
Template filter |escape accounts for __html__() when it's available.
|force_escape forces the use of Django's HTML escaping implementation.
Here's why the change in render_value_in_context() is safe. Before Django
1.7 conditional_escape() was implemented as follows:
if isinstance(text, SafeData):
return text
else:
return escape(text)
render_value_in_context() never called escape() on SafeData. Therefore
replacing escape() with conditional_escape() doesn't change the
autoescaping logic as it was originally intended.
This change should be backported to Django 1.7 because it corrects a
feature added in Django 1.7.
Thanks mitsuhiko for the report.
|
|
|
|
| |
generators and dict comprehension
|
| |
|
| |
|
| |
|
|
|
|
| |
It's only available during the rendering.
|
|
|
|
| |
Moved Django templates loading infrastructure there.
|
| |
|
| |
|
|
|
|
| |
refs #23395.
|
|
|
|
|
|
| |
property of an object when used in a template.
Thanks maraujop for the report and Hiroki and Tim Graham for review.
|
|
|
|
| |
django.template.resolve_variable().
|
|
|
|
| |
Thanks Piotr Kasprzyk for help with the patch.
|
|
|
|
|
|
|
|
|
|
| |
The docstring of FilterExpression said that it shouldn't be
instantiated from anywhere but the get_filters_from_token
helper function.
However, that helper function was deleted in commit
3ede006fc98f7e96ae9fb997872f78635576d5f8 and FilterExpression
is instantiated from inside the compile_filter help function.
|
| |
|
|
|
|
|
|
| |
Also renamed app_cache to apps and "app cache" to "app registry".
Deprecated AppCache.app_cache_ready() in favor of Apps.ready().
|
|
|
|
| |
Reverted 4a56a93cc458e9ab4dcab95d9f5067d4975dd1a2.
|
|
|
|
| |
Used the app cache's get_app_configs() method instead.
|
| |
|