store_tags.py 文件源码

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

项目:zing 作者: evernote 项目源码 文件源码
def do_include_raw(parser, token):
    """
    Performs a template include without parsing the context, just dumps
    the template in.
    Source: http://djangosnippets.org/snippets/1684/
    """
    bits = token.split_contents()
    if len(bits) != 2:
        raise template.TemplateSyntaxError(
            "%r tag takes one argument: the name of the template "
            "to be included" % bits[0]
        )

    template_name = bits[1]
    if (template_name[0] in ('"', "'") and
            template_name[-1] == template_name[0]):
        template_name = template_name[1:-1]

    source, __ = get_template_source(template_name)

    return template.base.TextNode(source)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号