gpt4 book ai didi

django - 关于 "parser"方法的文档在哪里?

转载 作者:行者123 更新时间:2023-12-01 07:31:41 26 4
gpt4 key购买 nike

我想知道这个(和其他)方法的作用:

parser.compile_filter()

最佳答案

唯一的官方文档,我相信你已经找到了 are here .

其他值得一看的好地方是 user group , developer group , source code ,以及 source code history ,

至于 compile_filter去。来源(带有文档字符串)说。

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

而 FilterExpression 是 documented here作为:

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'

关于django - 关于 "parser"方法的文档在哪里?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2743059/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com