X-Git-Url: http://git.ithinksw.org/philo.git/blobdiff_plain/9c0a07cbbdf9fdf91537e92527c1272acac15201..2e5a27da22a502a56a0e1bf278b906891e502335:/models/pages.py?ds=sidebyside diff --git a/models/pages.py b/models/pages.py index 4da5e99..b7b43c5 100644 --- a/models/pages.py +++ b/models/pages.py @@ -12,17 +12,13 @@ from philo.models.base import TreeModel, register_value_model from philo.models.fields import TemplateField from philo.models.nodes import View from philo.templatetags.containers import ContainerNode -from philo.utils import fattr, nodelist_crawl +from philo.utils import fattr from philo.validators import LOADED_TEMPLATE_ATTR from philo.signals import page_about_to_render_to_string, page_finished_rendering_to_string class LazyContainerFinder(object): - _created = 0 - _initialized = 0 - def __init__(self, nodes): - self.__class__._created += 1 self.nodes = nodes self.initialized = False self.contentlet_specs = set() @@ -41,11 +37,9 @@ class LazyContainerFinder(object): continue if isinstance(node, BlockNode): - #if nodelist == self.nodes: Necessary? self.blocks[node.name] = block = LazyContainerFinder(node.nodelist) - if block.nodes.get_nodes_by_type(BlockNode): # Is this faster? - block.initialize() - self.blocks.update(block.blocks) + block.initialize() + self.blocks.update(block.blocks) continue if isinstance(node, ExtendsNode): @@ -74,7 +68,6 @@ class LazyContainerFinder(object): if not self.initialized: self.process(self.nodes) self.initialized = True - self.__class__._initialized += 1 class Template(TreeModel): @@ -138,7 +131,7 @@ class Template(TreeModel): return contentlet_specs, contentreference_specs def __unicode__(self): - return self.get_path(pathsep=u' › ', field='name') + return self.name class Meta: app_label = 'philo'