From 8ed757abdbd0e015192308b55ca1186e12c55175 Mon Sep 17 00:00:00 2001 From: Joseph Spiros Date: Sun, 27 Jun 2010 07:15:15 -0400 Subject: [PATCH] Changing the Template container node detection code to use the child_nodelists attribute implemented on relevant nodes in Django 1.2. Therefore, Django 1.2 is now required. --- README | 2 +- models/pages.py | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/README b/README index 4170400..bf55344 100644 --- a/README +++ b/README @@ -2,7 +2,7 @@ Philo is a foundation for developing web content management systems. Prerequisites: * Python 2.5.4+ - * Django 1.1.1+ + * Django 1.2+ * (Optional) django-grappelli 2.0+ To contribute, please visit the project website . diff --git a/models/pages.py b/models/pages.py index 354293f..5f75494 100644 --- a/models/pages.py +++ b/models/pages.py @@ -43,9 +43,10 @@ class Template(TreeModel): nodes = [] for node in nodelist: try: - for nodelist_name in ('nodelist', 'nodelist_loop', 'nodelist_empty', 'nodelist_true', 'nodelist_false', 'nodelist_main'): - if hasattr(node, nodelist_name): - nodes.extend(nodelist_container_nodes(getattr(node, nodelist_name))) + if hasattr(node, 'child_nodelists'): + for nodelist_name in node.child_nodelists: + if hasattr(node, nodelist_name): + nodes.extend(nodelist_container_nodes(getattr(node, nodelist_name))) if isinstance(node, ContainerNode): nodes.append(node) elif isinstance(node, ExtendsNode): -- 2.20.1