Quantcast
Channel: Mako: Ticket Query
Viewing all articles
Browse latest Browse all 38

#171: default filters should be applied last

$
0
0

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  
    669669                if self.compiler.pagetag: 
    670670                    args = self.compiler.pagetag.filter_args.args + args 
    671671                if self.compiler.default_filters: 
    672                     args = self.compiler.default_filters + args 
     672                    args = args + self.compiler.default_filters 
    673673        for e in args: 
    674674            # if filter given as a function, get just the identifier portion 
    675675            if e == 'n': 

What do you think?

Cheers,

Pedro


Viewing all articles
Browse latest Browse all 38

Trending Articles