none if empty list decorator
this avoids checking if POST contains data for forms. see source for usage example
- decorator
- list
- empty
- none
this avoids checking if POST contains data for forms. see source for usage example
When writing clean and easy-to-read templates, it's usually good to have structural template tags (e.g. {%for%}, {%if%}) alone on their own line with proper indentation. When such a template is rendered, the resulting HTML will have blank lines in place of the template tags. The leading blank space used for indentation is also intact. This template tag strips all empty and all-whitespace lines when rendering the template. Be careful not to apply it when not intended, e.g. when empty lines are wanted inside PRE tags.
2 snippets posted so far.