开发者

Where is documentation about the "parser" methods?

I want to know what this ( and other )开发者_如何学C methods does:

parser.compile_filter()


The only official docs, which I'm sure you found are here.

Other good places to look are, the user group, the developer group, the source code, and the source code history,

As far as compile_filter goes. The source (with a docstring) says.

def compile_filter(self, token):
    "Convenient wrapper for FilterExpression"
    return FilterExpression(token, self)

And FilterExpression is documented here as:

Parses a variable token and its optional filters (all as a single string), and return a list of tuples of the filter name and arguments. Sample:

>>> token = 'variable|default:"Default value"|date:"Y-m-d"'
>>> p = Parser('')
>>> fe = FilterExpression(token, p)
>>> len(fe.filters)
2
>>> fe.var
'variable'
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜