From: Joseph Spiros Date: Thu, 4 Feb 2010 17:13:14 +0000 (-0500) Subject: Improving nodetree searching with support for IfNode and ForNode attributes. X-Git-Tag: philo-0.9~92 X-Git-Url: http://git.ithinksw.org/philo.git/commitdiff_plain/0a98574369a343ba6ac82aeca6250fca0383e80f?hp=-c Improving nodetree searching with support for IfNode and ForNode attributes. --- 0a98574369a343ba6ac82aeca6250fca0383e80f diff --git a/models.py b/models.py index 5089508..3a06d0a 100644 --- a/models.py +++ b/models.py @@ -240,8 +240,9 @@ class Template(TreeModel): names = [] for node in nodelist: try: - if hasattr(node, 'nodelist'): - names.extend(nodelist_container_node_names(node.nodelist)) + for nodelist_name in ('nodelist', 'nodelist_loop', 'nodelist_empty', 'nodelist_true', 'nodelist_false'): + if hasattr(node, nodelist_name): + names.extend(nodelist_container_node_names(getattr(node, nodelist_name))) if isinstance(node, ContainerNode): names.append(node.name) elif isinstance(node, ExtendsNode):