is there a way to use %def references somehow, basic idea being:
% if condition_a:
% func = %def_a
% elif condition_b:
% func = %def_b
... etc ...
${func( params )}
is there a way to use %def references somehow, basic idea being:
% if condition_a:
% func = %def_a
% elif condition_b:
% func = %def_b
... etc ...
${func( params )}
Yes like this:
% if condition_a:
<% func = def_a %>
% elif condition_b:
<% func = def_b %>
% endif
${func( params )}
@timmy: I have no idea what you mean, maybe this?
<% func = some_dict[key] %>
${func( params )}
You can put any Python code inside <% .. %>
, see the mako docs!