Join GitHub today
Exiting/Returning Early from a Template #236
Migrated issue, originally created by Cody Taylor (@CodeMan99)
The documentation for Returning early from a template should suggest return an empty string. Otherwise python returns
We should also consider adding a constant to represent exiting a template for two reasons.
I would be more than willing to implement this change, but I would not know where to add the suggested constant.
Michael Bayer (@zzzeek) wrote:
add the constant to mako/runtime.py, have it be available in templates which means its part of codegen.py in the symbols at the top (e.g. like UNDEFINED), then make the appropriate changes in the doc rst's. the docs have to include a ".. versionadded:: " directive to show that this constant isn't available in older versions of Mako also ( I can help format those).