def parse(self, parser):
lineno = next(parser.stream).lineno
# get the first parameter: the view name
args = [parser.parse_expression()]
# if there's a comma, we've also got an instance variable here
if parser.stream.skip_if('comma'):
args.append(parser.parse_expression())
else:
# no instance supplied for URL tag
args.append(nodes.Const(None))
return nodes.Output(
[self.call_method('_url', args)],
lineno=lineno
)
评论列表
文章目录