From: Joseph Spiros Date: Sun, 27 Jun 2010 11:15:15 +0000 (-0400) Subject: Changing the Template container node detection code to use the child_nodelists attrib... X-Git-Tag: philo-0.9~69 X-Git-Url: http://git.ithinksw.org/philo.git/commitdiff_plain/8ed757abdbd0e015192308b55ca1186e12c55175 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. --- 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):