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()
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):
if not self.initialized:
self.process(self.nodes)
self.initialized = True
- self.__class__._initialized += 1
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'