Dynamic Helpers

posted 2016-10-26 by Herb

DataZoomer apps can now define their own helpers on the fly. Simply define your helper by placing a callable in the system.helpers dict and then you can use it in content, like this:

from zoom import system, page

def setup():
    system.helpers['upper'] = unicode.upper

def app(request):
    content = """
       This should be in <dz:upper "upper case">
    return page(content, title='Helper Test')

That's it.