#19479: The {% include with...%} template tag does not accept boolean as value
---------------------------------+--------------------------------------
Reporter: italo.maia@… | Owner: nobody
Type: Bug | Status: closed
Component: Template system | Version: 1.4
Severity: Normal | Resolution: duplicate
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 charettes):
* status: new => closed
* cc: charette.s@… (added)
* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0
* resolution: => duplicate
Comment:
Couldn't reproduce against master:
{{{
simon@imac:~$ mktmpenv
New python executable in d58d6e9f-7c22-429a-9052-e34bf4642c03/bin/python
Installing
distribute.............................................................................................................................................................................................done.
Installing pip...............done.
virtualenvwrapper.user_scripts creating /home/simon/.virtualenvs/d58d6e9f-
7c22-429a-9052-e34bf4642c03/bin/predeactivate
virtualenvwrapper.user_scripts creating /home/simon/.virtualenvs/d58d6e9f-
7c22-429a-9052-e34bf4642c03/bin/postdeactivate
virtualenvwrapper.user_scripts creating /home/simon/.virtualenvs/d58d6e9f-
7c22-429a-9052-e34bf4642c03/bin/preactivate
virtualenvwrapper.user_scripts creating /home/simon/.virtualenvs/d58d6e9f-
7c22-429a-9052-e34bf4642c03/bin/postactivate
virtualenvwrapper.user_scripts creating /home/simon/.virtualenvs/d58d6e9f-
7c22-429a-9052-e34bf4642c03/bin/get_env_details
bash: cd: /home/simon/workspace/d58d6e9f-7c22-429a-9052-e34bf4642c03:
Aucun fichier ou dossier de ce type
This is a temporary environment. It will be deleted when you run
'deactivate'.
(d58d6e9f-7c22-429a-9052-e34bf4642c03)simon@imac:~/.virtualenvs/d58d6e9f-
7c22-429a-9052-e34bf4642c03$ pip install django==1.5
Downloading/unpacking django==1.5
Could not find a version that satisfies the requirement django==1.5
(from versions: )
No distributions matching the version for django==1.5
Storing complete log in /home/simon/.pip/pip.log
(d58d6e9f-7c22-429a-9052-e34bf4642c03)simon@imac:~/.virtualenvs/d58d6e9f-
7c22-429a-9052-e34bf4642c03$ pip install
https://github.com/django/django/archive/master.zip
Downloading/unpacking https://github.com/django/django/archive/master.zip
Downloading master.zip (11.5Mb): 11.5Mb downloaded
Running setup.py egg_info for package from
https://github.com/django/django/archive/master.zip
warning: no previously-included files matching '__pycache__' found
under directory '*'
warning: no previously-included files matching '*.py[co]' found under
directory '*'
Installing collected packages: Django
Running setup.py install for Django
changing mode of build/scripts-2.7/django-admin.py from 664 to 775
warning: no previously-included files matching '__pycache__' found
under directory '*'
warning: no previously-included files matching '*.py[co]' found under
directory '*'
changing mode of /home/simon/.virtualenvs/d58d6e9f-
7c22-429a-9052-e34bf4642c03/bin/django-admin.py to 775
Successfully installed Django
Cleaning up...
(d58d6e9f-7c22-429a-9052-e34bf4642c03)simon@imac:~/.virtualenvs/d58d6e9f-
7c22-429a-9052-e34bf4642c03$ django-admin.py startproject ticket_19479
(d58d6e9f-7c22-429a-9052-e34bf4642c03)simon@imac:~/.virtualenvs/d58d6e9f-
7c22-429a-9052-e34bf4642c03$ cd ticket_19479/
(d58d6e9f-7c22-429a-9052-e34bf4642c03)simon@imac:~/.virtualenvs/d58d6e9f-
7c22-429a-9052-e34bf4642c03/ticket_19479$ mkdir templates
(d58d6e9f-7c22-429a-9052-e34bf4642c03)simon@imac:~/.virtualenvs/d58d6e9f-
7c22-429a-9052-e34bf4642c03/ticket_19479$ echo "{% if param %}works{%
endif %}" > templates/included
(d58d6e9f-7c22-429a-9052-e34bf4642c03)simon@imac:~/.virtualenvs/d58d6e9f-
7c22-429a-9052-e34bf4642c03/ticket_19479$ echo "{% include \"included\"
with param=True %}" > templates/includer
(d58d6e9f-7c22-429a-9052-e34bf4642c03)simon@imac:~/.virtualenvs/d58d6e9f-
7c22-429a-9052-e34bf4642c03/ticket_19479$ python
Python 2.7.3 (default, Aug 1 2012, 05:14:39)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from django.conf import settings
>>> import os
>>> settings.configure(DEBUG=True, TEMPLATE_DEBUG=True,
TEMPLATE_DIRS=(os.path.join(os.getcwd(), 'templates'),))
>>> from django.template.loader import render_to_string
>>> render_to_string('includer')
u'works\n\n'
}}}
Prior to django 1.5 the `True`, `False` and `None` literals weren't
resolving to their Python equivalent in the template system.
That's the reason why it doesn't work for you here. For more details see
#17229.
Closing as duplicate.
--
Ticket URL: <https://code.djangoproject.com/ticket/19479#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 https://groups.google.com/groups/opt_out.