tags:

views:

20

answers:

1

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 )}
+1  A: 

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!

THC4k