This is a pretty routine thing I do:
{{ data['key'] or '' }}
so it won't display None
, but it also won't display a 0
and sometimes-- most of the time-- I really need 0
values to show, but never a None
.
What's the easiest fix for this? Something like {{ data['key']|none('') }}
where none
is a filter returning a blank if the value is None
?
Or something checking for a non-None
value inside the {{ ... }}
tags? What's your quick fix here?