#16348: {%with%} variable values not available in {%include%}'ed templates
-----------------------------------------+------------------------------
Reporter: leim@… | Owner: nobody
Type: Uncategorized | Status: new
Milestone: | Component: Core (Other)
Version: 1.2 | Severity: Normal
Resolution: | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-----------------------------------------+------------------------------
Changes (by aaugustin):
* needs_docs: => 0
* needs_tests: => 0
* needs_better_patch: => 0
Old description:
> I have the following scenario. (Django version: 1.2.3).
>
> Template A {%include%}'s Template B with a {%with%} block, ie.
>
> {%with 'aaa' as a %}
> {%include "template_b'%}
> {%endwith%}
>
> Any direct references to 'a' in template_b works just fine, including
> working with filters. However, 'a' does not appear to be included in the
> Request object's GET or POST. This means that, for example, any custom
> context processors attached to Template A does not see the variable 'a'.
>
> Is this expected behaviour? or I am missing some thing here?
>
> Thanks,
> Lei
New description:
I have the following scenario. (Django version: 1.2.3).
Template A `{% include %}`s Template B with a `{% with %}` block:
{{{
{% with 'aaa' as a %}
{% include "template_b' %}
{% endwith %}
}}}
Any direct references to 'a' in template_b works just fine, including
working with filters. However, `a` does not appear to be included in the
Request object's GET or POST. This means that, for example, any custom
context processors attached to Template A does not see the variable `a`.
Is this expected behaviour? or I am missing some thing here?
Thanks,
Lei
--
Comment:
Fixed formatting (please check the preview before submitting a bug).
--
Ticket URL: <https://code.djangoproject.com/ticket/16348#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en.