From 0a98574369a343ba6ac82aeca6250fca0383e80f Mon Sep 17 00:00:00 2001 From: Joseph Spiros Date: Thu, 4 Feb 2010 12:13:14 -0500 Subject: [PATCH] Improving nodetree searching with support for IfNode and ForNode attributes. --- models.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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): -- 2.20.1