django_mc_include_tags.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:django_mc 作者: team23 项目源码 文件源码
def parse(cls, parser, token):
        tokens = token.split_contents()
        tokens.pop(0)  # Pop the tag name.

        def make_variable(name):
            return template.Variable(name)

        def not_using(bit):
            return bit != "using"

        template_name_variables = map(make_variable, filter(
            not_using,
            takewhile(not_using, tokens)))
        hint_provider_variables = map(make_variable, filter(
            not_using,
            dropwhile(not_using, tokens)))

        return cls(template_name_variables, hint_provider_variables)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号