﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
7430	Recursively iterating through a template's nodes	miracle2k	Anders Hovmöller	"Right now, ''for node in Template()'' will only yield the top-level nodes. Is this the way it is intended to work? I was expecting to get all nodes, recursively.

The Template.!__iter!__ code looks like this:

{{{
    def __iter__(self):
        for node in self.nodelist:
            for subnode in node:
                yield subnode
}}}

And Node.!__iter!__ does:

{{{
    def __iter__(self):
        yield self
}}}

This looks like a precipe to allow nodes to yield their childnodes, without relying on the existence of the ''nodelist'' attribute.

However, nodes like BlockNode and ExtendsNode do not implement !__iter!__ - only ForNode and IfNode seem to do, and not in the way I would have expected (they don't yield self).

Is this a bug, or per design?"	Bug	closed	Template system	dev	Normal	wontfix			Unreviewed	0	0	0	0	0	0
