1 | | Me neither. I think ``TEMPLATE_STRING_IF_INVALID`` is kind of bad-practice debugging. So a +1 for deprecating it. What would be more elegant (but outside of django core) would be to have a django-debug-toolbar panel that lists all the "invalid" template variables used in the templates of the current page. But I don't know if an implementation is sanely possible at the moment (if there exist any usefull hooks in the template engine). |
| 1 | I don't use it either to debug. This bug report arose from a bug reported for django-floppyforms: https://github.com/brutasse/django-floppyforms/issues/37 . We rely heavily on the `default` filter in floppyforms for the form rendering. It's very handy for following occations: |
| 2 | |
| 3 | {{{ |
| 4 | # in hello.html |
| 5 | Hello {{ name|default:"John Doe" }}. |
| 6 | |
| 7 | # in index.html |
| 8 | {% include "hello.html" with name="Sam" %} # overwriting the default |
| 9 | {% include "hello.html" %} # using the default |
| 10 | }}} |
| 11 | |
| 12 | I think `TEMPLATE_STRING_IF_INVALID` is kind of bad-practice debugging. So a +1 for deprecating it. What would be more elegant (but outside of django core) would be to have a django-debug-toolbar panel that lists all the "invalid" template variables used in the templates of the current page. But I don't know if an implementation is sanely possible at the moment (if there exist any usefull hooks in the template engine). |