Changing the Template container node detection code to use the child_nodelists attrib...
authorJoseph Spiros <joseph.spiros@ithinksw.com>
Sun, 27 Jun 2010 11:15:15 +0000 (07:15 -0400)
committerJoseph Spiros <joseph.spiros@ithinksw.com>
Sun, 27 Jun 2010 11:15:15 +0000 (07:15 -0400)
README
models/pages.py

diff --git a/README b/README
index 4170400..bf55344 100644 (file)
--- a/README
+++ b/README
@@ -2,7 +2,7 @@ Philo is a foundation for developing web content management systems.
 
 Prerequisites:
        * Python 2.5.4+ <http://www.python.org/>
-       * Django 1.1.1+ <http://www.djangoproject.com/>
+       * Django 1.2+ <http://www.djangoproject.com/>
        * (Optional) django-grappelli 2.0+ <http://code.google.com/p/django-grappelli/>
 
 To contribute, please visit the project website <http://philo.ithinksw.org/>.
index 354293f..5f75494 100644 (file)
@@ -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):