Ticket #6586: extend.patch
File extend.patch, 1.1 KB (added by , 17 years ago) |
---|
-
loader_tags.py
41 41 self.nodelist = nodelist 42 42 self.parent_name, self.parent_name_expr = parent_name, parent_name_expr 43 43 self.template_dirs = template_dirs 44 if parent_name: 45 self.compiled_parent = self.get_parent(None) 46 else: 47 self.compiled_parent = None 44 48 45 49 def get_parent(self, context): 46 50 if self.parent_name_expr: … … 61 65 return get_template_from_string(source, origin, parent) 62 66 63 67 def render(self, context): 64 compiled_parent = self.get_parent(context) 68 if self.compiled_parent: 69 compiled_parent = self.compiled_parent 70 else: 71 compiled_parent = self.get_parent(context) 65 72 parent_is_child = isinstance(compiled_parent.nodelist[0], ExtendsNode) 66 73 parent_blocks = dict([(n.name, n) for n in compiled_parent.nodelist.get_nodes_by_type(BlockNode)]) 67 74 for block_node in self.nodelist.get_nodes_by_type(BlockNode):