Hello,
Using Pyramid I would like to filter expression that evaluate to None to be output as an empty string instead of "None". I have made a filter:
def none_escape(value):
""" Returns empty string if value is None - used as Mako filter. """
return value if value is not None else ''
and added the imports line to development.ini:
mako.imports = from sales.lib.helpers import none_escape
but when I add the filter to the default filters like this (because I still want the default html filter as well):
mako.default_filters = h, none_escape
I get the error:
NameError: global name 'h' is not defined
This only happens when I add ", none_escape" to the default filters line. It works with just "h" and the above imports line.
Is this a bug I should be submitting, or am I missing something trivial here?
Thanks,
Jason