Maybe I am wrong here, but shouldn't default filters such as unicode() be applied last? The fact that it's done the exactly opposite way makes it a pain, as we are limited to deal with the string/unicode representation of whatever variable is passed to the filter.
Hence, I propose the following change:
mako/codegen.py
diff -r 428b38caa618 mako/codegen.py
a b 669 669 if self.compiler.pagetag: 670 670 args = self.compiler.pagetag.filter_args.args + args 671 671 if self.compiler.default_filters: 672 args = self.compiler.default_filters + args672 args = args + self.compiler.default_filters 673 673 for e in args: 674 674 # if filter given as a function, get just the identifier portion 675 675 if e == 'n':
What do you think?
Cheers,
Pedro