#32157: Additional information to the "with" templatetag
-------------------------------------+-------------------------------------
Reporter: Jan | Owner: nobody
Hangebrauck |
Type: | Status: new
Cleanup/optimization |
Component: | Version: 3.1
Documentation |
Severity: Normal | Keywords: templatetags with
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
After a lot of bug searching, I found out that when I use a variable which
is None in the with templatetag, it is converted to empty string "". I'm
not sure if this is the intended behavior, but if it is, this could be
mentioned in the documentation.
in python:
context = { var1: None }
in template:
{% with x=var1 %}
{% if x is None %}
this will not print
{% endif %}
{% if x == "" %}
this will print
{% endif %}
{% endwith %}
--
Ticket URL: <https://code.djangoproject.com/ticket/32157>
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 unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/055.ff1d6a5016a17efac4b3e3d52a0ee455%40djangoproject.com.